-
-
Notifications
You must be signed in to change notification settings - Fork 480
github-[pr-][check|annotate]: Do not filter if no PR #2026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nils Wistoff <[email protected]>
Signed-off-by: Nils Wistoff <[email protected]>
cmd/reviewdog/main.go
Outdated
| } | ||
| ds = ghDiffService | ||
| cs = reviewdog.MultiCommentService(checkService, cs) | ||
| case "github-pr-annotations": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you introduce "github-annotations" reporter, similar to github-check to github-pr-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done. While doing so, I realized that github-check and github-pr-check are currently identical. I added a check that will fail if github-pr-[check|annotations] is run on a non-PR. Since this might be a breaking change, let me know if I should revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Can you revert the -pr checks?
Ideally, -pr-[check|annotations] reporters should be deprecated and everyone should use github-[check|annotations] for simplicity.
-pr-[check|annotations] reporters exists just for historical reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the -pr checks. Let me know if I should do anything about the deprecation.
CHANGELOG.md
Outdated
|
|
||
| ### :rocket: Enhancements | ||
| - ... | ||
| - [#2026](https://github.com/reviewdog/reviewdog/pull/2026) Add reporter for GitHub annotations `github-annotations` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you briefly mention it's the same as github-pr-annotations?
Ideally, we can also mention github-pr-annoations are deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Same as `github-pr-annotations`, but also works for regular commits. Throw an error when running `github-pr-[check|annotations` on non-PRs. Make documentation more consistent. Signed-off-by: Nils Wistoff <[email protected]>
Signed-off-by: Nils Wistoff <[email protected]>
ac276a6 to
44824d4
Compare
haya14busa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work!
|
Hi, @niwis! We merged your PR to reviewdog! 🐶 We just invited you to join the @reviewdog organization on GitHub. Thanks again! |
Reviewdog currently does not report anything for
github-[pr-][check|annotate]reporters when triggered by pushing a commit.Previously, diffs were not filtered when running reviewdog with
github-[pr-][check|annotate]reporters on a non-PR (e.g. push commit).reviewdog/doghouse/server/doghouse.go
Lines 61 to 65 in 1cf12d8
This makes sense because when not executed on a PR, the
DiffServiceis empty.reviewdog/cmd/reviewdog/main.go
Lines 665 to 675 in 7e8096c
However, 5e276ab changed the behaviour of reviewdog to always filter the diffs.
Restore the previous behaviour by setting
opt.filterMode = filter.ModeNoFilterwhen running on a non-PR.I think this might also resolve #1952