Skip to content
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

Create inline annotations for found violations #7

Closed
adangel opened this issue Nov 29, 2021 · 0 comments · Fixed by #12
Closed

Create inline annotations for found violations #7

adangel opened this issue Nov 29, 2021 · 0 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@adangel
Copy link
Member

adangel commented Nov 29, 2021

GitHub supports to show annotations on the file tab of a pull request or when viewing a single commit.
This PMD Action should create for each found violation that is in the pmd-report.sarif file such an inline annotation. The rule priorities can be used to map to either a error, warning or notice message.

The result might look like this:

grafik


Implementation notes:

  • With Setting an error message GitHub Actions can create build annotations as errors, warnings or notice.
  • The filename parameter probably needs to be relative to the repository root. With git rev-parse --show-toplevel one can figure out the current root checkout directory (which could be anywhere on the runner) and use that to make the absolute filepath in the sarif report into relative ones.
@adangel adangel added enhancement New feature or request help wanted Extra attention is needed labels Nov 29, 2021
@adangel adangel self-assigned this Dec 1, 2021
@adangel adangel removed the help wanted Extra attention is needed label Dec 1, 2021
@adangel adangel added this to the next milestone Dec 1, 2021
@adangel adangel changed the title Output build annotations for found violations Create inline annotations for found violations Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant