Add lefthook utility
What does this merge request do and why?
This adds Git hooks via Lefthook to automatically run
linting check before committing and pushing to remote repository. We can also run auto-fix
to
format code automatically.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Check out to this merge request's branch.
- Follow the instructions in the README to setup
lefthook
- Try to modify some files to trigger lint issue, e.g. move imports out of order
- Stage the change and try to commit
- The pre-commit hook should not allow to commit
Merge request checklist
-
I've ran the eval_codebase.py
pipeline to validate that nothing is broken. -
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Edited by Tan Le