Git Hooks
Qlty can be integrated into git using git hooks to ensure:
- code is formatted before committing (pre-commit hook)
- code meets quality standards before pushes (pre-push hook)
Installation
Installation is easiest using the Qlty CLI.
- First Install Qlty.
- Run:
See the hook files to understand what will be installed or to perform manual installation.
Pre-push
The Git pre-push hook will ensure that files are auto-formatted before pushing.
If there are files that are formatted incorrectly, it will format them and generate a new commit.
Due to the way Git works, when this occurs, you will need to run git push
again.
You can always run
git push --no-verify
to skip the pre-push hook.