- Configure Flake8 in `setup.cfg` or `.flake8`. Set `max-line-length = 100` and `max-complexity = 10`.
- Run `flake8 .` in CI. Fix all violations before merging.
- Configure `.flake8` with `max-line-length`, `extend-ignore`, and plugins — use `flake8-bugbear` for additional Python bug detection.
- Use `extend-ignore` for rules that conflict with Black formatting (E203, W503).
- Use plugins: `flake8-bugbear` (common bugs), `flake8-comprehensions` (better comprehensions), `flake8-simplify`.
- Use `per-file-ignores` for relaxed rules on tests and migrations.
- Use `# noqa: E501` comments sparingly — prefer refactoring over silencing.