You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pip install pre-commit
cd to_your_repo
pre-commit --version
make sure you have .pre-commit-config.yaml file at the root of the repo
pre-commit install # this will create `.git/hooks/pre-commit` executable file
Deliberately I have a file tests/tests_example.py which should fail.
pre-commit run --all-files # gives fail error.
Once the pre-commit command is run in GitHub repo, usual git commands will use the git hooks automatically. This means whenever we run git commit -m "hello" the command will fail if it does not meet the requirements.
The text was updated successfully, but these errors were encountered:
Add pre-commit hooks for debug-statements and so on.
Make sure you do not accidentally commit wrong commits.
Reference: https://github.com/pre-commit/pre-commit-hooks
Using pre-commit:
Once the pre-commit command is run in GitHub repo, usual git commands will use the git hooks automatically. This means whenever we run
git commit -m "hello"
the command will fail if it does not meet the requirements.The text was updated successfully, but these errors were encountered: