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

feat: use problem matchers for GitHub Action format #4685

Merged
merged 3 commits into from
May 2, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented May 1, 2024

Currently, when running the GitHub Action each annotation creates 2 outputs:

  • a "popup"
  • a log

The "popup" works well but the log doesn't display the file information (path, position).

The default annotations format ::error file={name},line={line},col={endLine}::{message} doesn't display the file information (I don't know why).

This PR uses a specific feature called "Problem Matchers" that allows defining a custom format.
With this custom format, the log displays file information.

Screenshot log

Screenshot popup summary

Screenshot popup code

Fixes golangci/golangci-lint-action#119

@ldez ldez added enhancement New feature or improvement area: output Related to issue output labels May 1, 2024
@ldez ldez added this to the next milestone May 1, 2024
Copy link
Member

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

pkg/printers/github.go Outdated Show resolved Hide resolved
ldez and others added 2 commits May 2, 2024 22:38
Co-authored-by: Simon Sawert <simon@sawert.se>
@ldez ldez merged commit 28b3813 into golangci:master May 2, 2024
13 checks passed
@ldez ldez deleted the feat/github-action-format branch May 2, 2024 20:58
@ldez ldez modified the milestones: next, v1.58 May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: output Related to issue output enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

github action log output doesn't print the affected file name & line
2 participants