Code review
Ask for a quick review with /review or a deep one that verifies every finding, and fix what it found in one step.
NoBreiniers reviews your changes in two ways: a quick review, which is the usual one, and a deep one, which tries to refute every finding before it shows it to you.
Quick review
- In the message box type
/reviewand send. Plain words work too: «review my changes». - The chat's agent reviews your work on the branch since the place where it began (the app finds that place by itself and says in a note how it did) and answers in the chat. If it cannot tell where the branch began, it reviews the uncommitted changes and says so. It changes nothing.
| You type | What it reviews |
|---|---|
/review | Your work on this branch since it began, committed or not. |
/review uncommitted | Only this folder's uncommitted changes. |
/review main | The changes since that branch or version. |
/review 12 | Pull request number 12. |
The «Review» button in the «Changes» panel does the same.
Deep review
- Type
/review deep. The same may follow it:/review deep main,/review deep 12. - Under the chat the «Code review» bar shows what is going on: «Reviewing», then «Verifying … candidates».
- When it ends you see the verified findings, the most serious first.
What it does differently:
- Several reviewers look at the change at once, each with a focus: bugs, security and your project's rules.
- A second pass tries to refute each candidate: it reproduces it by running code, or traces it through the code and quotes the lines. If it cannot, the candidate is dropped.
- You only see what was verified. The rest is counted as «… left out».
Each finding says:
| Fact | Values |
|---|---|
| Severity | «Important», «Minor» or «Pre-existing» (it was there before your change) |
| Confidence | «high confidence», «medium confidence» or «low confidence» |
| How it was verified | «Reproduced by running code» or «Traced by reading the code» |
Fix the findings in one step
On the «Code review» bar:
| Button | What it does |
|---|---|
| «Show the findings» | Opens or closes the list. |
| «Fix the important findings» | Fixes only the important ones. The changes stay uncommitted, for you to look at. |
| «Post the findings on the PR» | Leaves them as comments on the pull request. |
| «More review options» | «Fix every finding», «Fix and push to the PR's branch» or «Fix on a new branch with its own PR». |
| «Stop the review» | Cuts it short. |
Before fixing, the app asks for your approval and says exactly what it will do. Afterwards each finding is in one of three states:
- «Fixed: its check passes»: the finding's own check failed before the fix and passes after it.
- «Changed, not checked»: it was changed, but the finding had no check to prove it.
- «Not fixed».
Tune the review of a project
Create the file .nobreiniers/review.yaml in your repository:
| Key | What it is for |
|---|---|
effort | How wide the review looks: low uses a single reviewer; high adds one that looks at who calls the changed code. |
rules | More rule files the review must enforce, such as docs/review.md. |
paths | include and exclude: which folders are reviewed. |
auto | open and update: review a pull request by itself when it opens or when it is pushed to. |
min_score | From which score a finding is shown. |
test | The command run after fixing, to catch a false fix. |
