- Install dependencies
brew install pre-commit terraform-docs
- Install the git hook scripts
run pre-commit install to set up the git hook scripts
pre-commit install
- [optional] Test pre-commit hooks
pre-commit run -a
- Done
pre-commit hooks will check:
- validate terraform config
- check yaml formattings
- format terraform config
- fix missing
\n
at the end of files - fix trailing whitespaces