Pre-commit hooks that catch Django problems early
summary
Covers concrete rules and failures: uses pre-commit hooks plus GitHub Actions as a CI safety net, runs hooks like pyupgrade, isort, flake8, Bandit, Django system checks and a make-migrations hook to catch missed migrations, stray PDB/debug statements, and hardcoded keys. Notes that pre-commit only sees staged files (exclude patterns must not start with a leading slash), hook order matters (formatters first, Django checks last), demo shows detection of a private key and debug breakpoint and GitHub Actions rejecting pushes that bypass --no-verify.
AI-written summary · about
chapters (33)
- 0:00Introduction to pre-commits
- 1:28Common Django commit issues
- 2:33How pre-commits work
- 4:01Pre-commit files and setup
- 5:04Pre-commit visibility limits
- 6:54Excluding migration files
- 7:18Order of pre-commit hooks
- 8:00Types of pre-commit hooks
- 9:04Security keys in commits
- 10:11Passing files to pre-commits
- 10:56Django system checks
- 11:36Bypassing pre-commit hooks
- 12:18CI as second layer of security
- 13:03Repo vs local environment
- 13:44When not to use pre-commits
- 14:51Reducing commit chunk size
- 15:18Demo of pre-commit file
- 16:21Benefits of unified checks
- 17:23Default pre-commit hooks
- 18:06Security hooks like Bandit
- 19:08Installing pre-commits locally
- 20:20Git hooks integration
- 21:04Running pre-commits on all files
- 22:12CI pre-commits and GitHub actions
- 23:17Q&A session starts
- 24:00Caching pre-commits in CI
- 24:42Detecting missing migrations
- 25:46Local CI vs pre-commits
- 26:30Running test suites in pre-commits
- 27:33Handling exposed secrets in CI
- 28:16Pre-commits and security layers
- 29:18Alternatives to pre-commits
- 29:39Closing remarks and thanks
