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.
This commit is contained in:
parent
2aee84c755
commit
56549a0195
3 changed files with 5 additions and 21 deletions
|
|
@ -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-format.
|
||||
clang-format --Wno-error=unknown -i "$f"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue