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

Non-zero exit code on found problems #20

Closed
NobbZ opened this issue Nov 18, 2021 · 7 comments · Fixed by #34
Closed

Non-zero exit code on found problems #20

NobbZ opened this issue Nov 18, 2021 · 7 comments · Fixed by #34
Labels
bug Something isn't working

Comments

@NobbZ
Copy link
Contributor

NobbZ commented Nov 18, 2021

I checked statix today and except for the unquoted splices (#8) and empty pattern I agree with its suggestions on my projects and I'd like to add it to CI.

Though to make any use of it in CI, it is required that we get a non-zero exit code on found suggestions.

@nerdypepper nerdypepper added the bug Something isn't working label Nov 19, 2021
@nerdypepper
Copy link
Owner

Though to make any use of it in CI, it is required that we get a non-zero exit code on found suggestions.

Understood, will try to work on this over the weekend.

empty pattern

Feel free to open an issue about this as well. I'd be happy to update the rule if you feel it is noisy.

@m1-s
Copy link

m1-s commented Jan 19, 2022

Any news on this? We also would like to integrate statix into our CI but without proper return codes its useless to us.

@nerdypepper
Copy link
Owner

Sorry, this slipped my radar again, the next release will contain this fix.

@SuperSandro2000
Copy link

How about adding a -q argument like grep?

@nerdypepper
Copy link
Owner

i have opened #34 to fix this, behavior is as follows:

  • exit with 1 if warnings or syntax errors are present
  • exit with 0 if no warnings are produced

@nerdypepper
Copy link
Owner

@SuperSandro2000 hmm, is that any different from redirecting all output of statix to /dev/null?

@meain
Copy link

meain commented Jan 23, 2022

One thing that I think grep does along with just silencing output is to exit immediately as soon a single match is found and not doing the full search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants