Autoreview

This is a paid feature. Please contact us on Discord or subscribe to use it.

Grit auto-review is a feature that allows you to automatically review pull requests for potential issues before merging.

Process

When enabled, Grit will automatically review all pull requests for potential issues (including drafts). If the pull request author is not opted into any rules, the review will be skipped.

Grit reports the review status as a check on the pull request.

pull request check

After Grit completes its review of the pull request, it will report the results as a check on the pull request. The check will pass if there are no blocking issues found, and fail if there are blocking issues found.

Additionally, Grit will leave line-by-line comments on the pull request to provide more detailed information about the issues found. (Note: this is skipped on draft pull requests.)

Levels

When a rule has a level of warn it will not fail the review if the rule is violated (but a comment will still be left).

Rules with a level of error will block the pull request by adding a comment and marking the pull request as failed with an ❌ in the status check.

Disabled rules will not be reviewed.

Adding new rules

In addition to adding rules through the web UI, you can also simply mention /grit new in any pull request comment to have Grit synthesize a new rule based on the feedback you provide.

/grit new <explanation>

Create a new autoreview rule based on the comment contents. This should be used as an inline comment on a specific line of code.

Comment adding a new autoreview rule

Improving recommendations

The best way to improve the quality of the Grit reviews is to provide feedback on pull requests.

/grit reject

When replying to a code review from Grit, you can write /grit reject in a comment to reject the finding as a false positive.

Example of reporting a missed positive

/grit report <url>

If Grit fails to flag an issue with an existing rule, you can comment /grit report <url> on the pull request to improve the Grit AI. This will attach the line comment to the linked rule.

Example of reporting a missed case