@@ -23,28 +23,32 @@ jobs:
2323 runs-on : ubuntu-latest
2424 steps :
2525 - name : Install flake8
26- run : sudo apt update && sudo apt -y install flake8
26+ run : sudo apt update && sudo apt -y install file flake8
2727
2828 - uses : actions/checkout@v4
2929 with :
3030 fetch-depth : 0
3131
32- - name : Run Flake8
33- run : flake8 scripts/*.py
32+ - name : Run Flake8 and dependencies
33+ run : |
34+ . scripts/functions
35+ scan_files text/x-script.python flake8
3436
3537 pylint :
3638 name : Install and run Pylint on Python scripts
3739 runs-on : ubuntu-latest
3840 steps :
39- - name : Install Pylint
40- run : sudo apt update && sudo apt -y install pylint
41+ - name : Install Pylint and dependencies
42+ run : sudo apt update && sudo apt -y install file pylint python3-voluptuous
4143
4244 - uses : actions/checkout@v4
4345 with :
4446 fetch-depth : 0
4547
4648 - name : Run Pylint (error mode)
47- run : pylint --errors-only scripts/*.py
49+ run : |
50+ . scripts/functions
51+ scan_files text/x-script.python pylint --errors-only
4852
4953 shellcheck :
5054 name : Install and run ShellCheck on shell scripts
@@ -59,12 +63,12 @@ jobs:
5963
6064 - name : Run ShellCheck
6165 run : |
62- # Run shellcheck against all files outside .git/ that `file` reports
63- # as text/x-shellscript
64- #
66+ . scripts/functions
67+
6568 # Ignore the double quoting warning, script authors have better
66- # knowledge of variable contents.
67- export SHELLCHECK_OPTS="-e SC2086"
68- find . -path ./.git -prune -o -print0 | \
69- xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "text/x-shellscript" && printf "%s\000" "$1"' -- | \
70- xargs -0t shellcheck
69+ # knowledge of variable contents, and we accept that in practice
70+ # "local" is implemented everywhere so it's OK to use even though
71+ # it's not strictly POSIX.
72+ export SHELLCHECK_OPTS="-e SC2086,SC3043"
73+
74+ scan_files text/x-shellscript shellcheck
0 commit comments