Skip to content

Commit

Permalink
ci: lint shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sethfischer committed Jun 11, 2021
1 parent 5374674 commit 50ba205
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ jobs:
run: |
sudo apt-get -y install scour
make lint-svg
- name: Lint shell scripts
run: |
sudo apt-get -y install shellcheck
make lint-shell
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: lint
lint: lint-c lint-svg
lint: lint-c lint-shell lint-svg

.PHONY: lint-c lint-svg
lint-c lint-svg:
.PHONY: lint-c lint-shell lint-svg
lint-c lint-shell lint-svg:
./$@.sh
8 changes: 8 additions & 0 deletions lint-shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -o errexit -o noclobber -o nounset
shopt -s globstar

directory="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

git ls-files -z -- "${directory}/**.sh" | xargs --no-run-if-empty --null shellcheck

0 comments on commit 50ba205

Please sign in to comment.