Skip to content

Commit 2c16b08

Browse files
authored
Merge pull request #1998 from craigcomstock/local-lint
Refactored shellcheck workflow to be ci/lint.sh and lint.yml workflow
2 parents a4fe2e4 + 22c0c0b commit 2c16b08

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@ jobs:
1818
run: sudo apt install shellcheck
1919
- name: Lint sources with shellcheck
2020
run: |
21-
# Recursively find all shell scripts in the build-scripts directory with a shebang
22-
grep -Erl '^(#!/(bin|usr/bin)/(env )?(sh|bash))' build-scripts/ | while read -r file; do
23-
shellcheck --external-sources --source-path=build-scripts "$file"
24-
done
21+
./ci/lint.sh

ci/lint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
shellcheck_dirs() {
3+
grep -Erl '^(#!/(bin|usr/bin)/(env )?(sh|bash))' "$1" | while read -r file; do
4+
shellcheck --external-sources --source-path=build-scripts "$file"
5+
done
6+
}
7+
8+
shellcheck_dirs build-scripts/
9+
10+
# some dirs are "dirty" aka need some work so don't fail on those yet
11+
shellcheck_dirs ci/ packaging/ || true

0 commit comments

Comments
 (0)