Skip to content

Latest commit

Β 

History

History
41 lines (25 loc) Β· 1.15 KB

SETUP_PRE-COMMIT_HOOKS.md

File metadata and controls

41 lines (25 loc) Β· 1.15 KB

Setup pre-commit hooks πŸ‘¨πŸ»β€πŸ’»

Table of contents

Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. Checkout pre-commit hook site for more details.

You can setup pre-commit hook by running:

brew install pre-commit

or if you prefer pip

pip install pre-commit

You can have a look at some basic pre-commit hooks that I have added under pre-commit-config.yml file. You can checkout all the pre-commit hooks here. And add any hook that you like in this file.

Now, install the pre-commit hook by running:

pre-commit install

you will see

pre-commit installed at .git/hooks/pre-commit

This means pre-commit hook were installed successfully.