Skip to content

Commit 3a21097

Browse files
committed
Make sure splint.log exists even if no code files match.
Only lint `*.c` files as the headers will be included there and then won't result in bogus warnings about unused functions. Drop gnuextensions flag which may have broken the latest python action.
1 parent caa77b9 commit 3a21097

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/python-c-ext-sanity-check.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ jobs:
8686
fetch-depth: 0 # This is necessary to get the commits
8787
- name: Lint with splint
8888
run: |
89+
touch splint.log
8990
# NOTE: we only run splint error check for changed C files to limit noise
9091
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
91-
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
92+
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
9293
# NOTE: show splint warnings but don't fail unless it found critical errors
93-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib +gnuextensions -D__gnuc_va_list=va_list $(python3-config --includes) &> splint.log || true
94+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes) &> splint.log || true
9495
cat splint.log
9596
grep '*** Cannot continue' splint.log && false
9697
@@ -112,12 +113,13 @@ jobs:
112113
fetch-depth: 0 # This is necessary to get the commits
113114
- name: Lint with splint
114115
run: |
116+
touch splint.log
115117
# NOTE: we only run splint error check for changed C files to limit noise
116118
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
117-
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
119+
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
118120
# NOTE: splint complains about NATIVE_TSS_KEY_T in system header here
119121
# NOTE: show splint warnings but don't fail unless it found critical errors
120-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib +gnuextensions -D__gnuc_va_list=va_list -DNATIVE_TSS_KEY_T=char $(python3-config --includes) &> splint.log || true
122+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list -DNATIVE_TSS_KEY_T=char $(python3-config --includes) &> splint.log || true
121123
cat splint.log
122124
grep '*** Cannot continue' splint.log && false
123125
@@ -153,11 +155,12 @@ jobs:
153155
run: |
154156
# NOTE: perms are not right inside container so repeat what checkout module does.
155157
git config --global --add safe.directory "$PWD"
158+
touch splint.log
156159
# NOTE: we only run splint error check for changed C files to limit noise
157-
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
160+
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$')"
158161
echo "with splint from $(which splint)"
159162
ls -l /bin/splint
160163
# NOTE: show splint warnings but don't fail unless it found critical errors
161-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib +gnuextensions -D__gnuc_va_list=va_list &> splint.log || true
164+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.c$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list &> splint.log || true
162165
cat splint.log
163166
grep '*** Cannot continue' splint.log && false

0 commit comments

Comments
 (0)