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

Action output not helpful #965

Closed
3 tasks done
andig opened this issue Feb 8, 2024 · 6 comments
Closed
3 tasks done

Action output not helpful #965

andig opened this issue Feb 8, 2024 · 6 comments

Comments

@andig
Copy link

andig commented Feb 8, 2024

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

Lint action output is not helpful in that

  • issues are not visible at first sight when looking into the action log and
  • issues apparently sometimes omit filenames
Screenshot 2024-02-08 at 15 27 17

Version of golangci-lint

Not sure

Version of the GitHub Action

golangci/golangci-lint-action@v3

Workflow file

https://github.com/evcc-io/evcc/blob/0631f600926faa0fc3566c3ac9ff2c6c8fa8c8ed/.github/workflows/default.yml#L98-L102

https://github.com/evcc-io/evcc/blob/0631f600926faa0fc3566c3ac9ff2c6c8fa8c8ed/.golangci.yml

Go version

1.22.0

Code example or link to a public repository

https://github.com/evcc-io/evcc/actions/runs/7830801405/job/21365710661?pr=11007

@gaby
Copy link

gaby commented Feb 9, 2024

I'm having the same problem, there's no output. Enabling annotation makes 0 difference.

@iamnande

This comment was marked as off-topic.

@ldez
Copy link
Member

ldez commented Feb 16, 2024

Since v3.6.0 of the action, you can now provide extra args to add extra output format.

Example:

    - name: Golangci Lint
      uses: golangci/golangci-lint-action@v4
      with:
        version: v1.56.2
        args: --out-format=colored-line-number

https://golangci-lint.run/usage/configuration/#output-configuration

Related to #769

Duplicate of #618, #119

@ldez ldez closed this as completed Feb 16, 2024
@andig
Copy link
Author

andig commented Feb 16, 2024

@ldez thank you. It would still be nice to see the linter messages during the run phase right in the log without needing to expand the "run golangci-lint" section.

@ldez
Copy link
Member

ldez commented May 3, 2024

The problem will be fixed with golangci-lint v1.58: the file information (path, position) will be displayed.

golangci/golangci-lint#4685

@ldez
Copy link
Member

ldez commented May 4, 2024

I added a new option annotations, which may be useful to some of you.

I added this option for several reasons:

  • The number of annotations is limited.
  • Some people don't want to use annotations and just want the classic colored-line-number format.

If you set annotations to false, the output format(s) will follow the golangci-lint configuration file (or CLI flags from args) and use the same default as golangci-lint (i.e. colored-line-number).

https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#annotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants