-
Notifications
You must be signed in to change notification settings - Fork 45
review a pull request
Todd Tyree edited this page Jul 16, 2018
·
8 revisions
There are a number of different ways to do this. However, this is the way we want it done in Platform:
- Are there tests? If so, do they pass?
- Don't review anything that has failing tests-ask the PR owner to fix the tests first.
- If not, why not?
- Does the PR have a description?
- A PR should always have a description summarising its context. Why has the PR been raised and what issue does it address?
- Is there an issue for this PR in Github?
- Generally speaking, a PR should always be linked to a specific issue. The issue should be linked or mentioned in the description.
- Does the PR do what is specified in the issue?
- Does the issue have a checklist? If so, has the owner of the PR checked all the items? Has the owner checked the relevant items if the PR does not close the issue?
- Can you undertand what the code is doing without having it explained?
- Declarative code in discrete, organised units is best. However,
you can also use comments, commit messages and threads in issues
(in that order).
- Well-named variables are an essential component of declarative code. Do the variable names all give you an idea of what they do?
- If you cannot understand the code, start a conversation on the PR
about what you do not understand.
- Be concise about what you don't understand.
- Try to link your comments to specific lines of code so that updates to the PR will close them.
- Declarative code in discrete, organised units is best. However,
you can also use comments, commit messages and threads in issues
(in that order).
- Does the code have any obvious howlers?
- We all make mistakes and miss things. We all ignore old bits of bad code when we're in a hurry. If you notice anything like this in code you're reviewing, ask the PR issuer to fix it.
- If it's something old that was there before they started and they ask if they can skip it, ask them to open an issue to fix it later.
- Give kudos for the good things you see in a PR.
- A 👍 or encouraging remark on something well done goes a long way.
- Don't sweat the implementation details.
- If the code works, is clear and conforms to standards of style and consistency don't spend a lot of time asking for changes.
There is something of a (simple) art to getting these right. Chris Beam has a great blog post on how to write them. The TL;DR version is:
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how