Skip to content

Commit ba09d89

Browse files
committed
Adjust splint linting action to always show lint output but only fail on
critical errors.
1 parent 1d88ea4 commit ba09d89

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,13 @@ jobs:
8686
fetch-depth: 0 # This is necessary to get the commits
8787
- name: Lint with splint
8888
run: |
89-
# NOTE: we only run splint error check for changed c files to limit noise
89+
# NOTE: we only run splint error check for changed C files to limit noise
9090
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
9191
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
92-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes)
92+
# 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 -D__gnuc_va_list=va_list $(python3-config --includes) -check &> splint.log || true
94+
cat splint.log
95+
grep '*** Cannot continue' splint.log && false
9396
9497
lint-c-ext-python3-ubuntu-lts:
9598
name: Sanity check c-extension module code in latest Ubuntu LTS python3
@@ -109,10 +112,13 @@ jobs:
109112
fetch-depth: 0 # This is necessary to get the commits
110113
- name: Lint with splint
111114
run: |
112-
# NOTE: we only run splint error check for changed c files to limit noise
115+
# NOTE: we only run splint error check for changed C files to limit noise
113116
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
114117
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
115-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes)
118+
# NOTE: show splint warnings but don't fail unless it found critical errors
119+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes) -check &> splint.log || true
120+
cat splint.log
121+
grep '*** Cannot continue' splint.log && false
116122
117123
lint-c-ext-python3-rocky9:
118124
name: Sanity check c-extension module code in default python3 on Rocky9
@@ -144,11 +150,13 @@ jobs:
144150
fetch-depth: 0 # This is necessary to get the commits
145151
- name: Lint with splint
146152
run: |
147-
# NOTE: we only run splint error check for changed c files to limit noise
148153
# NOTE: perms are not right inside container so repeat what checkout module does.
149-
# NOTE: include tests here as they should be fully python3 compatible
150154
git config --global --add safe.directory "$PWD"
155+
# NOTE: we only run splint error check for changed C files to limit noise
151156
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
152157
echo "with splint from $(which splint)"
153158
ls -l /bin/splint
154-
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list
159+
# NOTE: show splint warnings but don't fail unless it found critical errors
160+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list -check &> splint.log || true
161+
cat splint.log
162+
grep '*** Cannot continue' splint.log && false

0 commit comments

Comments
 (0)