Skip to content

Commit 2149996

Browse files
committed
Fix CI coding-style check failures
1 parent 6a15181 commit 2149996

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.ci/check-format.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ set -x
88

99
REPO_ROOT="$(git rev-parse --show-toplevel)"
1010

11-
C_SOURCES=$(find "${REPO_ROOT}" | egrep "\.(c|cxx|cpp|h|hpp)$")
11+
# Use git ls-files to only check files tracked by git (excludes submodules and generated files)
12+
C_SOURCES=$(git ls-files "${REPO_ROOT}" | egrep "\.(c|cxx|cpp|h|hpp)$")
1213
for file in ${C_SOURCES}; do
1314
clang-format-18 ${file} > expected-format
1415
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
1516
done
1617
C_MISMATCH_LINE_CNT=$(clang-format-18 --output-replacements-xml ${C_SOURCES} | egrep -c "</replacement>")
1718

18-
SH_SOURCES=$(find "${REPO_ROOT}" | egrep "\.sh$")
19+
SH_SOURCES=$(git ls-files "${REPO_ROOT}" | egrep "\.sh$")
1920
for file in ${SH_SOURCES}; do
2021
shfmt -d "${file}"
2122
done
22-
SH_MISMATCH_FILE_CNT=$(shfmt -l ${SH_SOURCES})
23+
SH_MISMATCH_FILE_CNT=$(shfmt -l ${SH_SOURCES} | wc -l)
2324

24-
PY_SOURCES=$(find "${REPO_ROOT}" | egrep "\.py$")
25+
PY_SOURCES=$(git ls-files "${REPO_ROOT}" | egrep "\.py$")
2526
for file in ${PY_SOURCES}; do
2627
echo "Checking Python file: ${file}"
2728
black --diff "${file}"

.ci/jit-debug-test.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
PARALLEL="${PARALLEL:--j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)}"
8+
PARALLEL="${PARALLEL:--j$(nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 4)}"
99

1010
echo "======================================"
1111
echo "JIT Debug Mode Test"
@@ -39,8 +39,7 @@ for config in \
3939
"ENABLE_EXT_F=0" \
4040
"ENABLE_EXT_M=0" \
4141
"ENABLE_Zba=0" \
42-
"ENABLE_Zbb=0"
43-
do
42+
"ENABLE_Zbb=0"; do
4443
echo ""
4544
echo "Testing: $config with JIT debug"
4645
make distclean

0 commit comments

Comments
 (0)