Skip to content

Commit 22c0c0b

Browse files
committed
Refactored shellcheck workflow to be ci/lint.sh and lint.yml workflow
Also added ci/ and packaging/ but allowed those to fail. Ticket: none Changelog: none
1 parent a4fe2e4 commit 22c0c0b

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

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)