Skip to content

Commit 1bdeec6

Browse files
committed
Fix the CI lint step feeding a bash script to the Python parser
The file discovery ran `find -exec head -1 {} \; -print` and then `grep -B1 python3`. Because -print comes after head, the output is shebang-then-path, so -B1 selected the path of the *previous* file rather than the one whose shebang matched. neuros-firstboot (#!/bin/bash) got picked up that way and ast.parse reported "SyntaxError: invalid syntax. Perhaps you forgot a comma?", failing the job on every push since the check was added. Replaced it with a plain glob that tests each file's own shebang. All 79 Python scripts under usr/local/bin parse.
1 parent 13a3ada commit 1bdeec6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ jobs:
4444
run: |
4545
echo "Checking Python syntax..."
4646
FAILED=0
47-
for f in $(find config/includes.chroot/usr/local/bin -type f \
48-
-exec head -1 {} \; -print | grep -B1 'python3' | grep '^config/' || true); do
47+
for f in config/includes.chroot/usr/local/bin/*; do
48+
[ -f "$f" ] || continue
49+
head -1 "$f" | grep -q python3 || continue
4950
python3 -c "import ast; ast.parse(open('$f').read())" \
5051
&& echo "OK: ${f##*/}" || { echo "FAIL: ${f##*/}"; FAILED=$((FAILED+1)); }
5152
done

0 commit comments

Comments
 (0)