- Code reviews are everyone's responsibility
- Reply to a code review request as soon as you can
- Limit the number of reviewers (no more than 2)
- Remember to praise
- Reviews should be based on agreed-on coding standards, not personal preferences
- Does it meet the Acceptance Criteria?
- Do you understand it?
- Don't hesitate to pull down the code and run it on your machine
- Formatting, style and syntax should be enforced by tooling
- Prefer questions to demands
- Avoid assumptions, ask for clarification
- Link to documentation, blog articles...
- Are the tests testing the behaviour rather than the implementation details?
- If it's a new service, could you start it up on your own?
- If it's an integration with a 3rd party, could you run it on your own?
- Is the author re-inventing a pattern that is already present in the codebase?
- Once you're happy with the changes and you're confident the developer will address the remaining comments you can approve with suggestions so that the author can merge the changes without requiring any further interaction
- Prefix comments with "Nit: " to indicate to the author that they're not expected to fix them
- If you find some major design issues, provide feedback immediately rather than reviewing the whole Pull Request
- Drive-by comment: leaving a single comment without following through or approving the changes, hence forcing the Pull Request author to contact you
- Oral feedback: not capturing the feedback that led to changes, if it's not written it'll be forgotten
Sometimes you go back and forth a few times on a specific comment without reaching an agreement:
- If possible discuss face to face
- If you still can't resolve the issue, involve a third person
- Code Review Best Practices - Palantir Technologies
- Code Review - thoughtbot
- Code review guidelines - Madalin Ilie
- Code Review Guidance - The Nerdery
- How to Make Good Code Reviews Better - Stack Overflow blog
- How to do a code review - Google (the document is hard to navigate but contains valuable guidance,
CL
stands for changelist as defined in the terminology)