Skip to content

Return zero on non-error findings #3095

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

Closed
ajhenry opened this issue Aug 12, 2022 · 2 comments
Closed

Return zero on non-error findings #3095

ajhenry opened this issue Aug 12, 2022 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@ajhenry
Copy link

ajhenry commented Aug 12, 2022

Your feature request related to a problem? Please describe.

The program always returns non-zero when there are findings of any severity level. It almost makes severity levels pointless if my CI job always errors on all findings.

For example, I expect that only info findings would return 0:

Config

severity:
  default-severity: error
  rules:
    - linters:
        - revive
      severity: info

Output

Running [golangci-lint-1.47.3-linux-amd64/golangci-lint run --out-format=github-actions --config .golangci.yaml] in [] ...
  ::info file=file/file.go,line=95,col=6::exported: type name will be used as file.FileFilter by other packages, and that stutters; consider calling this Filter (revive)

  Error: issues found
  Ran golangci-lint in 95641ms

Describe the solution you'd like.

I would like the program to return 0 on anything other than error.

Describe alternatives you've considered.

Not too sure if there's a workaround for this. It lowers the confidence of my CI job if I make the lint step non-mandatory because there are only warnings/info.

Additional context.

I am adding linting to an existing codebase and already added 100+ //nolint comments for the error severity levels to be fixed at a later time. But warning and info also return a non-zero code.

If anyone has a solution for this, that would be great!

@ajhenry ajhenry added the enhancement New feature or improvement label Aug 12, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 12, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Aug 12, 2022

seems like a duplicate of #1981

#2595 (comment)

@ldez ldez added duplicate This issue or pull request already exists and removed enhancement New feature or improvement labels Mar 21, 2024
@ldez ldez closed this as completed Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants