-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement statix Linter and Fixer #3969
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great if you can add a test for the linter handler with common output generated by the linter.
Add `statix check` as a linter. Provides a simple set of definition tests additionally. Variable names specify "check" to allow for later addition of `statix fix` as a formatter once stream support is added. Signed-off-by: David Houston <houstdav000@gmail.com>
I didn't realise there were two separate lists of tools, so add statix to the other list. Also, remembered "S" comes after "R", and so re-ordered it. Signed-off-by: David Houston <houstdav000@gmail.com>
I refactored the variables for statix to allow for writing a fixer later, and forgot to update them in the test, so update them now. Also remove a stray "i", add missing space before checks Signed-off-by: David Houston <houstdav000@gmail.com>
statix v0.4.0 provides a breaking change of output stream from stderr to stdout. Signed-off-by: David Houston <houstdav000@gmail.com>
Implement statix fix as a fixer for simple Nix antipatterns. Signed-off-by: David Houston <houstdav000@gmail.com>
Fix the statix fixer tests by removing the unnecessary 'read_temporary_file' value from the command, since it simply uses the default value. Signed-off-by: David Houston <houstdav000@gmail.com>
Add a test for the statix handler per @hsanson's request. Signed-off-by: David Houston <houstdav000@gmail.com>
Alright, added a handler test in 0cea76d, and ensured the tests pass locally. |
Signed-off-by: David Houston <houstdav000@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the contribution.
Write an implementation for statix to use as both a linter and a fixer, using
statix check
andstatix fix
respectively.I previously made a PR for this as #3967, and closed it when I realized there were breaking changes with the v0.4.0 release. This implementation works with v0.4.0, and adds fixer support as well.
Made some minor ale-nix.txt formatting fixes as well left over from my previous implementation of nixfmt and from nixpkgs-fmt.