Interview Prep/Python for DevOps/Testing, services & metrics

What is `pre-commit`, and what hooks are standard for Python repos?

IntermediateConceptTesting, services & metrics
Answer

pre-commit manages Git hooks defined in .pre-commit-config.yaml, running checks on staged files before each commit. Typical hooks: ruff (lint + format), mypy, check-yaml, end-of-file-fixer, detect-private-key, gitleaks for secrets, bandit for security issues. Run pre-commit run --all-files in CI as well, since local hooks can be skipped with --no-verify.

All Python for DevOps questions Roadmap: Python for automation

More on Testing, services & metrics