Skip to content

Add lefthook utility

Tan Le requested to merge add-lefthook into main

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.

  1. Check out to this merge request's branch.
  2. Follow the instructions in the README to setup lefthook
  3. Try to modify some files to trigger lint issue, e.g. move imports out of order
  4. Stage the change and try to commit
  5. 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

Merge request reports

Loading