mirror-chatterino2/tools/check-format.sh
pajlada f191de2514
Add CI workflow to check line endings of all source files (#2082)
In addition, all found errors (formatting & line ending) have been fixed in this PR.
2020-10-18 15:54:48 +02:00

21 lines
444 B
Bash
Executable file

#!/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"