Check all changes in GNU Bash script on commit!
https://github.com/Lin-Buo-Ren/Git_Pre-commit_Hook_for_GNU_Bash_Projects
This project has been superseded by pre-commit - A framework for managing and maintaining multi-language pre-commit hooks, which is far more flexible and feature-rich than this project can provide. It is recommended to use that instead.
A sample pre-commit and Travis CI configuration has applied to this project for reference, checkout the .pre-commit-config.yaml
and .travis.yml
file for more info.
林博仁 et. al.
GPLv3
- Install ShellCheck, and make sure
shellcheck
is in yourPATH
environment variable - Add this Git repository as your project's sub-module
- Create a symbolic link to
pre-commit.bash
from.git/hooks/pre-commit
- Profit! All your bash scripts with
.bash
filename extension in staging area will be automatically checked by ShellCheck during commit attempt, commit will fail if any warnings or errors occurred.