Code Style
Ensure code is readable, maintainable, and robust.
Review Checklist
- Clarity: Are variable and function names descriptive? Is complexity justified?
- Correctness: Are edge cases handled? Are errors propagated or logged appropriately?
- Tests: Is behavior covered by unit or integration tests? Are flaky tests addressed?
- Consistency: Do naming, formatting, and patterns match the surrounding codebase?
Common Anti-patterns
- Deeply nested conditionals; prefer early returns and guard clauses.
- Magic numbers and strings; extract into named constants.
- Tight coupling; favor explicit interfaces and dependency injection.
Testing Practices
- Write tests that describe behavior, not implementation details.
- Use table-driven tests for multiple similar cases.
- Mock only external boundaries (I/O, network, time), not internal logic.
Static Analysis
- Configure linters tightly at project setup; relax rules only with team agreement.
- Treat warnings as errors in CI to prevent drift.
- Review suppressions with the same rigor as code changes.
Feedback Tone
- Be constructive and specific.
- Suggest concrete alternatives or reference examples when requesting changes.