From a9d7f45924b97a5244fb626dd9ae0bf934ca1ee6 Mon Sep 17 00:00:00 2001 From: David Houston Date: Thu, 11 Nov 2021 17:34:25 -0500 Subject: Implement statix Linter and Fixer (#3969) * Add Statix for Linting 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 * Fixup Supported Tools List 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 * Fix statix Test File 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 * Update Output Stream for v0.4.0 statix v0.4.0 provides a breaking change of output stream from stderr to stdout. Signed-off-by: David Houston * Add statix fix Fixer Implement statix fix as a fixer for simple Nix antipatterns. Signed-off-by: David Houston * Fix statix Fixer Tests 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 * Add statix Handler Test Add a test for the statix handler per @hsanson's request. Signed-off-by: David Houston * Fix to run only on stdin for linting Signed-off-by: David Houston --- supported-tools.md | 1 + 1 file changed, 1 insertion(+) (limited to 'supported-tools.md') diff --git a/supported-tools.md b/supported-tools.md index ab02b006..a0da372c 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -349,6 +349,7 @@ formatting. * [nixfmt](https://github.com/serokell/nixfmt) * [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) * [rnix-lsp](https://github.com/nix-community/rnix-lsp) + * [statix](https://github.com/nerdypepper/statix) * nroff * [alex](https://github.com/wooorm/alex) :floppy_disk: * [proselint](http://proselint.com/) -- cgit v1.2.3