The unrelated image is of Shaun's new bicycle. Onward to code review:

Initial Checklist

Before reading the code we check these things:

  • Do none of the PR files change when we auto-format them?
  • Can we build the code in one step?
  • Does the build pass?
  • Do all the tests pass (except those meant to fail)?
  • Does the code analysis pass?
    • linters
    • style cops
    • type checkers
  • Does the application start?

For a Node project with TypeScript that means the following should just work.

git clone [email protected]:Company/repository.git
git checkout topic-branch
npm install
npm run build
npm run test
npm run typeCheck
npm run start

Then We Do This

Create a list of files.

git diff master... --stat > code-review-notes.txt

// or 

git diff master... --stat | vim -

This helps because:

  • it acts as a checklist for files that we have already reviewed, and
  • it lets us take notes on files; these notes might be worth sharing later.

For each file in the list, take notes on it. Then mark it as "done" when its review is complete.

Understand what the code is doing. Then write down a short, precise description. This description helps because:

  • it lets us share our understanding of the code with its author, and
  • it provides a basis for checking its actual behavior against its requirements.

More to come...