-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: style check shell files with shfmt
This commit introduces checking style formatting issues with [`shfmt`][1]. [1]: https://github.com/mvdan/sh
- Loading branch information
1 parent
1208d8c
commit 68335e3
Showing
8 changed files
with
29 additions
and
15 deletions.
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 |
---|---|---|
|
@@ -15,6 +15,20 @@ jobs: | |
sudo cp "shellcheck-v${{ env.SHELLCHECK_VERSION }}/shellcheck" /usr/local/bin/ | ||
- name: verify shell scripts | ||
run: shellcheck hadolint.sh lib/*.sh test/*.sh | ||
shfmt: | ||
runs-on: ubuntu-20.04 | ||
name: shfmt | ||
env: | ||
SHFMT_VERSION: 3.3.0 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: install shfmt | ||
run: | | ||
wget -q -O shfmt "https://github.com/mvdan/sh/releases/download/v${{ env.SHFMT_VERSION }}/shfmt_v${{ env.SHFMT_VERSION }}_linux_amd64" | ||
chmod +x shfmt | ||
sudo cp shfmt /usr/local/bin/ | ||
- name: lint shell scripts | ||
run: shfmt -i 2 -d hadolint.sh lib/*.sh test/*.sh | ||
prettier: | ||
runs-on: ubuntu-20.04 | ||
name: prettier | ||
|
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
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
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 |
---|---|---|
|
@@ -17,4 +17,4 @@ function validate_output_format() { | |
[[ "${format}" == "${1}" ]] && return 0 | ||
done | ||
return 1 | ||
} | ||
} |
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