3131
3232 - name : Run Flake8 and dependencies
3333 run : |
34- # Run flake8 against all files outside .git/ that `file` reports
35- # as text/x-script.python
36- find . -path ./.git -prune -o -print0 | \
37- xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "text/x-script.python" && printf "%s\000" "$1"' -- | \
38- xargs -0t flake8
34+ . scripts/functions
35+ scan_files text/x-script.python flake8
3936
4037 pylint :
4138 name : Install and run Pylint on Python scripts
5047
5148 - name : Run Pylint (error mode)
5249 run : |
53- # Run pylint against all files outside .git/ that `file` reports
54- # as text/x-script.python
55- find . -path ./.git -prune -o -print0 | \
56- xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "text/x-script.python" && printf "%s\000" "$1"' -- | \
57- xargs -0t pylint --errors-only
50+ . scripts/functions
51+ scan_files text/x-script.python pylint --errors-only
5852
5953 shellcheck :
6054 name : Install and run ShellCheck on shell scripts
@@ -69,12 +63,12 @@ jobs:
6963
7064 - name : Run ShellCheck
7165 run : |
72- # Run shellcheck against all files outside .git/ that `file` reports
73- # as text/x-shellscript
74- #
66+ . scripts/functions
67+
7568 # Ignore the double quoting warning, script authors have better
76- # knowledge of variable contents.
77- export SHELLCHECK_OPTS="-e SC2086"
78- find . -path ./.git -prune -o -print0 | \
79- xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "text/x-shellscript" && printf "%s\000" "$1"' -- | \
80- 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