BLT provides Git hooks that must be symlinked into your local repository’s .git
directory, using the blt:init:git-hooks
task during the onboarding process.
These hooks should be used on all projects, as they will save developers time. In particular, the pre-commit hook will prevent a Git commit if validation fails on the code being committed (which will also occur during blt:validate
calls during continuous integration).
Provided Hooks
BLT provides the following default hooks for your use:
- commit-msg: Validates the syntax of a Git commit message before it is committed locally.
- pre-commit: Runs Drupal Code Sniffer on committed code before it is committed locally.