Git hooks to integrate with pre-commit.
Add to .pre-commit-config.yaml
in your git repo.
- repo: https://github.com/Firebladee/pre_commit_hooks
rev: master
hooks:
- id: shellcheck
- id: shellcheck_docker
If you want to invoke the checks as a git pre-commit hook, run:
pre-commit install
If you want to run the checks on-demand (outside of git hooks), run:
pre-commit run --all-files --verbose
What it does
Run shellcheck against scripts.
More info
This hook uses the identify
library of pre-commit to identify shell scripts.
If the file is a shell script, then run shellcheck against the file.
By default, this hooks passes -e SC1091
to shellcheck.
Override locally with the args
parameter in .pre-commit-config.yaml
.
shellcheck
hook requires
shellcheck.
What it does
Run shellcheck using a docker instance of shellcheck against your scripts.
More info
This hook uses the identify
library of pre-commit to identify shell scripts.
If the file is a shell script, then run shellcheck against the file.