summaryrefslogtreecommitdiffstats
path: root/misc/scripts/clang_tidy.sh
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-02-01 09:55:07 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-02-01 09:58:57 +0100
commit56549a019594d68121ac17781f7450aa82a06db2 (patch)
treee3df202d1dcdaee5eb5f7b2854423098bc2e7308 /misc/scripts/clang_tidy.sh
parent2aee84c755ccb5674b257d7b281bbfb7a3769f44 (diff)
downloadredot-engine-56549a019594d68121ac17781f7450aa82a06db2.tar.gz
CI: Fix exclude patterns with `git ls-files`
Follow-up to #55785. In `black_format.sh`, the `--exclude` switch was wrongly used. It's a misnomer that only excludes _untracked_ files, arcane pathspec patterns should instead be used to exclude _tracked_ files. Using this newfound knowledge, we can also simplify the other scripts.
Diffstat (limited to 'misc/scripts/clang_tidy.sh')
-rwxr-xr-xmisc/scripts/clang_tidy.sh12
1 files changed, 2 insertions, 10 deletions
diff --git a/misc/scripts/clang_tidy.sh b/misc/scripts/clang_tidy.sh
index 85519c0e72..e49f6ac9f4 100755
--- a/misc/scripts/clang_tidy.sh
+++ b/misc/scripts/clang_tidy.sh
@@ -6,17 +6,9 @@
set -uo pipefail
# Loops through all code files tracked by Git.
-git ls-files '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' |
+git ls-files -- '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' \
+ ':!:.git/*' ':!:thirdparty/*' ':!:platform/android/java/lib/src/com/google/*' ':!:*-so_wrap.*' |
while read -r f; do
- # Exclude some files.
- if [[ "$f" == "thirdparty"* ]]; then
- continue
- elif [[ "$f" == "platform/android/java/lib/src/com/google"* ]]; then
- continue
- elif [[ "$f" == *"-so_wrap."* ]]; then
- continue
- fi
-
# Run clang-tidy.
clang-tidy --quiet --fix "$f" &> /dev/null