summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-02-01 10:42:44 +0100
committerGitHub <noreply@github.com>2022-02-01 10:42:44 +0100
commita1469bff19294c2cfd5c103d1e80540a9d883dda (patch)
treee3df202d1dcdaee5eb5f7b2854423098bc2e7308
parent2aee84c755ccb5674b257d7b281bbfb7a3769f44 (diff)
parent56549a019594d68121ac17781f7450aa82a06db2 (diff)
Merge pull request #57505 from akien-mga/ci-scripts-fix-exclude-pattern
-rwxr-xr-xmisc/scripts/black_format.sh2
-rwxr-xr-xmisc/scripts/clang_format.sh12
-rwxr-xr-xmisc/scripts/clang_tidy.sh12
3 files changed, 5 insertions, 21 deletions
diff --git a/misc/scripts/black_format.sh b/misc/scripts/black_format.sh
index 45d7f9dd2b..99343f1c5a 100755
--- a/misc/scripts/black_format.sh
+++ b/misc/scripts/black_format.sh
@@ -6,7 +6,7 @@ set -uo pipefail
# Apply black.
echo -e "Formatting Python files..."
-PY_FILES=$(git ls-files '*SConstruct' '*SCsub' '*.py' --exclude='.git/*' --exclude='thirdparty/*')
+PY_FILES=$(git ls-files -- '*SConstruct' '*SCsub' '*.py' ':!:.git/*' ':!:thirdparty/*')
black -l 120 $PY_FILES
diff=$(git diff --color)
diff --git a/misc/scripts/clang_format.sh b/misc/scripts/clang_format.sh
index 311944d3b4..13b5ab79b6 100755
--- a/misc/scripts/clang_format.sh
+++ b/misc/scripts/clang_format.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-format.
clang-format --Wno-error=unknown -i "$f"
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