Practical Notes
- Quant gate: make CI fail when new issues appear (diff-only mode).
- Tip: start with
-reporter=localbefore wiring PR credentials.
Pattern: “diff-only” quality gate
When a repo has a backlog of existing issues, the fastest rollout is only comment on new problems introduced by the PR.
Pick one linter and ensure it prints file/line/col.
Pipe to reviewdog with diff filtering:
<your_linter_cmd> | reviewdog -f=golint -reporter=github-pr-review -filter-mode=diff_context- Tighten gradually:
- Start as
github-pr-review(developer-friendly), - then switch to
github-check(status checks) if you want a strict merge gate.
Pattern: unify many linters into one “review surface”
If your CI runs multiple tools (format, security, deps, etc.), keep the PR readable:
- Use a consistent reporter (Checks or Review),
- use consistent severity mapping,
- keep messages short and actionable (first sentence: what to change).
Troubleshooting
- If nothing posts: validate you’re running in a PR context and tokens are present.
- If comments are too noisy: use diff filtering, or limit to changed paths only.
FAQ
Q: Do I have to use GitHub Actions? A: No. reviewdog can run in many CI systems; the key is having a PR diff context when you want PR comments.
Q: Can I run it locally?
A: Yes. Use -reporter=local to validate parsing and formatting before wiring CI credentials.
Q: How do I avoid commenting on old issues?
A: Use diff filtering (-filter-mode=diff_context) so only new issues are surfaced.