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
Pre-commit is a Git hook that triggers when git commit is attempted.
Get started
pip install pre-commit #this is actually in the requirements.txt so as long as you install packages with it you will have it
Run pre-commit install #this installs everything needed for the hooks within .pre-commit-config.yaml
Run pre-commit run --all-files #the first time pre-commit is added to the project so all files are checked
Usage
Commits are not saved until they pass the pre-commit.
Based on the example configuration, all files must pass pyright then black formatting.
Errors will provide details about the files and why the process failed. Fix the issues and commit again until they pass.
Pre-commit prevents pushing to the code base until they pass.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What is pre-commit?
Pre-commit is a Git hook that triggers when git commit is attempted.
Get started
Usage
Beta Was this translation helpful? Give feedback.
All reactions