# Install pre-commit
pip install pre-commit
# Install the git hooks
pre-commit install
# (Optional) Run against all files to verify
pre-commit run --all-files- black: Code formatting (88 char line length)
- isort: Import statement sorting
- flake8: Linting and style checking
- mypy: Type checking (on src/madengine only)
- bandit: Security vulnerability scanning
- General checks: trailing whitespace, YAML/JSON validity, large files, merge conflicts
Pre-commit will now run automatically on git commit. If any hook fails:
- Review the output
- Fix the issues (many are auto-fixed)
- Stage the changes:
git add <files> - Commit again:
git commit
# Skip all hooks (emergency only)
git commit --no-verify
# Skip specific hooks
SKIP=mypy git commit# Run on staged files
pre-commit run
# Run on all files
pre-commit run --all-files
# Run specific hook
pre-commit run black --all-files# Update to latest versions
pre-commit autoupdate