ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

Report the output via GitHub annotations #51

Closed ZehMatt closed 1 year ago

ZehMatt commented 2 years ago

The comments unfortunately introduce a lot of noise and GitHub has a way to make the reporting a bit better.

Example: https://github.com/golangci/golangci-lint-action#golangci-lint-action

This is achieved with https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md

ZedThree commented 2 years ago

Very happy to add this as an option (PRs welcome!), but it does have two downsides:

  1. limited number of annotations
  2. I don't think you can use the fixits as suggestions

I also wasn't sure if actions could create annotations when I first wrote this, but it seems it is now possible

ZehMatt commented 2 years ago

I think having it as an alternative option to comments would be great.

ZedThree commented 1 year ago

I'm going to release this in v0.12 now, as I won't have much time to improve this for a while. PRs to make this feature better are more than welcome!

For future reference, the check-runs REST API, which is how to use annotations, is documented here: https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

Although locally, one must have a GitHub App Installation Token to post annotations, as the fine-grained PAT just doesn't have access to it, it turns out that the GITHUB_TOKEN in the Action does have access, which is why this works without having to create a whole GitHub App