This repository has been archived by the owner on Mar 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
PR Review HOWTO
James O. D. Hunt edited this page Dec 14, 2017
·
4 revisions
This document attempts to capture some of the points to consider when reviewing a PR to ensure code quality is kept as high as possible.
- Could the change introduce a potential issue?
- What additional checks would resolve it?
- What happens on failure? (Consider every possible failure)
- Will this change negatively impact performance?
- Can any calls block? If so, there should be a log call before the blocking call explaining what is about to be done.
- How easy would this code be to maintain
- By an experienced developer?
- By a developer with none / almost no experience of the codebase?
- Does the change improve or worsen usabililty?
- Could it be made any better?
- Consider all inputs and outputs.
- What resources are being used? (memory, disk, etc) Are they released?
- Are all return values and arguments checked?
- Are there any magic numbers?
- Is formatting and naming consistent?
- Are there any spelling mistakes ("typos")?
- Do all new files contain the required licence header?
- Could the code be simplified / refactored?
- Is the code "too clever"? Overly clever code tends to be fragile: reject it unless there is a very good documented reason!
- Is there a better solution to the problem?
- Is there any duplication?
- What assumptions does the code make? Are they valid? Are they documented?
- Does the code make sense?
- Could someone with minimal exposure to the codebase guess at what it is doing? (hint: they should be able to).
- Does this change require an update to the
README
(s) / architecture docs? - Is the code sufficiently well commented?
- Are all functions documented (or for
go
are they purpose obvious?) - Does the document update need to be applied to any other documents (for example, when a PR updates an installation guide, those same changes may need to be applied to one or more of the other installation guides!)
- Could this code be debugged from a logfile if it failed?
- Are error messages and log calls useful and comprehensive? Ensure sensitive information is not displayed though.
- Has the code been written to be easy to test?
- Are there new tests? If not, why?
- Will the code work on all distributions?
- What environments will this code run in?
- Which user will the code run as?
- If the code logs state, how will upgrades be handled?
- Provide constructive comments on the code.
- If you like some aspect particularly, say so! 😄
- Ensure all automated checks pass.
- Ensure the PR contains atleast one
Fixes #XXX
commit message referencing an issue that this PR fixes.