dev: Rename tools directory to scripts (#5035)

This commit is contained in:
pajlada
2023-12-17 13:37:30 +01:00
committed by GitHub
parent aa11a24163
commit 5dd8c1c88a
10 changed files with 5 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
# scripts
This directory contains scripts that may be useful for a contributor to run while working on Chatterino
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
docker build -f .docker/Dockerfile.build -t chatterino-ubuntu-build .docker
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -eu
fail="0"
clang-format --version
while read -r file; do
if ! diff -u <(cat "$file") <(clang-format "$file"); then
echo "$file differs!!!!!!!"
fail="1"
fi
done < <(find src/ -type f \( -iname "*.hpp" -o -iname "*.cpp" \))
if [ "$fail" = "1" ]; then
echo "At least one file is poorly formatted - check the output above"
exit 1
fi
echo "Everything seems to be formatted properly! Good job"
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -eu
fail="0"
dos2unix --version
while read -r file; do
num_dos_line_endings=$(dos2unix -id "$file" | awk '/[0-9]+/{print $(NF-1)}')
if [ "$num_dos_line_endings" -gt "0" ]; then
>&2 echo "File '$file' contains $num_dos_line_endings DOS line-endings, it should only be using unix line-endings!"
fail="1"
fi
done < <(find src/ -type f \( -iname "*.hpp" -o -iname "*.cpp" \))
if [ "$fail" = "1" ]; then
>&2 echo "At least one file is not using unix line-endings - check the output above"
exit 1
fi
>&2 echo "Every file seems to be using unix line-endings. Good job!"
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
read -p "Are you sure you want to run clang-format on all source files? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
find src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
find tests/src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
find benchmarks/src/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
find mocks/include/ \( -iname "*.hpp" -o -iname "*.cpp" \) -exec clang-format -i {} \;
fi
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
#Download the official list of active TLDs from IANA
#Remove the first line that contains data not needed.
#Put everything that can be into lowercase.
#Output the result to a file.
curl -s 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | sed -e '1d' -e 's/\(.*\)/\L\1/' > tlds.txt
#Get the TLDs in punycode format.
#Convert the punycode to Unicode.
#Append the results to the current file.
sed -n -e '/^xn--/p' tlds.txt | idn2 -d >> tlds.txt
mv tlds.txt ../resources/tlds.txt
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
wget https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json -O ../resources/emoji.json
+1
View File
@@ -0,0 +1 @@
find . -not -path "*.git*" -exec fsutil.exe file setCaseSensitiveInfo {} disable \;