oppiliappan / statix

lints and suggestions for the nix programming language
https://git.peppe.rs/languages/statix/about
MIT License
557 stars 21 forks source link

Non-zero exit code on found problems #20

Closed NobbZ closed 2 years ago

NobbZ commented 2 years ago

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.

oppiliappan commented 2 years ago

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 commented 2 years ago

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

oppiliappan commented 2 years ago

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

SuperSandro2000 commented 2 years ago

How about adding a -q argument like grep?

oppiliappan commented 2 years ago

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

oppiliappan commented 2 years ago

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

meain commented 2 years ago

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.