-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9b8e5e
commit 423d61a
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: ShellCheck | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install ShellCheck | ||
run: sudo apt-get install -y shellcheck | ||
- name: Run shellcheck | ||
run: ./shellcheck.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# enable additional checks | ||
enable=add-default-case | ||
enable=avoid-nullary-conditions | ||
enable=check-set-e-suppressed | ||
enable=check-unassigned-uppercase | ||
enable=deprecate-which | ||
|
||
# unused variable warning | ||
disable=SC2034 | ||
|
||
# cd fail | ||
disable=SC2164 | ||
|
||
# dont follow source files | ||
disable=SC1091 | ||
|
||
# unnecessary arithmetic variables style | ||
disable=SC2004 | ||
|
||
# variables in printf string | ||
# we use variables as constants for defining the pattern at the beginning of the file | ||
disable=SC2059 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
export IFS=$'\n' | ||
[ -z "$(command -v shellcheck)" ] && echo "shellcheck not installed!" && exit 1 | ||
shellcheck --version | ||
|
||
SHELLCHECK_ARGS=() | ||
SHELLCHECK_ARGS+=(--wiki-link-count=256) | ||
|
||
declare -a FILES | ||
mapfile -t FILES < <(find . -type f -name '*.sh') | ||
|
||
shellcheck \ | ||
"${SHELLCHECK_ARGS[@]}" \ | ||
"$@" \ | ||
"${FILES[@]}" |