Skip to content

Commit

Permalink
refactor: separate lint shfmt and shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
egel committed Sep 14, 2024
1 parent 1b97d62 commit 06554e6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.PHONY: check-scripts
check-scripts:
@# Fail if any of these files have warnings
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" -o -iname "*.tmux" \) | xargs -I % sh -c 'shellcheck %'
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" -o -iname "*.tmux" \) | xargs -I % sh -c 'shfmt -l -d %'
.PHONY: lint_shellcheck
lint_shellcheck:
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" -o -iname "*.tmux" \) | \
xargs -I % sh -c 'shellcheck %'

.PHONY: lint_shfmt
lint_shfmt:
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" -o -iname "*.tmux" \) | \
xargs -I % sh -c 'shfmt -l -d %'

.PHONY: check_scripts
check_scripts: lint_shellcheck lint_shfmt

0 comments on commit 06554e6

Please sign in to comment.