pre-commit Hooks
Automatic checks before every commit: formatting, large files and private keys.
Steps
Install the tool: pip install pre-commit.
Create .pre-commit-config.yaml.
Enable it: pre-commit install.
Run it on all files: pre-commit run --all-files.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace