1.1 KiB
1.1 KiB
Code Review
Security and quality review of uncommitted changes.
Workflow
- Get changed files:
git diff --name-only HEADandgit diff --staged --name-only - Review each file for issues (see checklist below)
- Run automated checks:
mypy src/,ruff check src/,pytest -x - Generate report with severity, location, description, suggested fix
- Block commit if CRITICAL or HIGH issues found
Checklist
CRITICAL (Block)
- Hardcoded credentials, API keys, tokens, passwords
- SQL injection (must use parameterized queries)
- Path traversal risks
- Missing input validation on API endpoints
- Missing authentication/authorization
HIGH (Block)
- Functions > 50 lines, files > 800 lines
- Nesting depth > 4 levels
- Missing error handling or bare
except: print()in production code (use logging)- Mutable default arguments
MEDIUM (Warn)
- Missing type hints on public functions
- Missing tests for new code
- Duplicate code, magic numbers
- Unused imports/variables
- TODO/FIXME comments
Report Format
[SEVERITY] file:line - Issue description
Suggested fix: ...