ci: Add shellcheck for scripts (#20631)
Fixes shellcheck errors in script/* Adds a couple trailing newlines. Adds `script/shellcheck-scripts` and associated CI machinery. Current set ultra-conservative, does not output warnings, only errors.
This commit is contained in:
1 parent
f91bb7b181
commit
6b8b8ab73b
10 files changed
+48
-12
No files matched your search
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
mode=${1:-error}
|
||||
[[ "$mode" =~ ^(error|warning)$ ]] || { echo "Usage: $0 [error|warning]"; exit 1; }
|
||||
|
||||
cd "$(dirname "$0")/.." || exit 1
|
||||
|
||||
find script -maxdepth 1 -type f -print0 |
|
||||
xargs -0 grep -l -E '^#!(/bin/|/usr/bin/env )(sh|bash|dash)' |
|
||||
xargs -r shellcheck -x -S "$mode" -C
|
||||
Reference in new issue
Block a user