feat: add shellcheck & shfmt github actions (#33)

* refactor: separate lint shfmt and shellcheck
* feat: add simple github action task
* fix: linting bash files according to shfmt
* feat: move main method dedicated shell file
* feat: update changelog entry
This commit is contained in:
Maciej Sypien 2024-09-14 23:49:03 +02:00 committed by Maciej Sypien
parent 1b97d625e6
commit 23bbbfcaee
No known key found for this signature in database
GPG key ID: 10BC01EDA6827DC8
5 changed files with 63 additions and 31 deletions

View file

@ -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" \) | \
xargs -I % sh -c 'shellcheck %'
.PHONY: lint_shfmt
lint_shfmt:
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" \) | \
xargs -I % sh -c 'shfmt -i=2 -l -d -ln=bash %'
.PHONY: check_scripts
check_scripts: lint_shellcheck lint_shfmt