statix
statix copied to clipboard
lints and suggestions for the nix programming language
I tried adding the following as a check for my flake ``` ${statix}/bin/statix check --config ${./statix.toml} ${./.} ``` and the config was being ignored. I'm having to do this instead...
Check for repeated keys in attrsets. For example: ``` foo.bar1 = 1; foo.bar2 = 2; foo.bar3 = 3; ``` should recommend creating a ``` foo = { ... } ```...
This is a nixpkgs policy. Not adding a replacement suggestion at this point, because it seems very tricky to preserve the formatting and potential comments when reordering.
`[] ++ something` should be reduced to just `something`
When there are more than 6 arguments, suggest splitting into multiple lines.
Warn on unused bindings/varaibles.
I have the following in my flake.nix ```nix outputs = {...} @ inputs: import ./desktop/outputs.nix inputs; ``` running `statix check flake.nix` shows this: ```nix [W11] Warning: Found redundant pattern bind...
I have a fun one. A situation where the useless_parens lint is triggered, although removing the parentheses changes the semantics. Consider ``` (builtins.foldl') or "false" list_of_something_boolish ``` where `or` is...
When doing some source filtering, I came across some weird behavior. When checking a directory with `statix check `, statix aborts when coming across a directory that has either no...
I've also written a linter for Nix a few years ago, see https://github.com/Synthetica9/nix-linter Once this has all the checks that that has, I'd be fine with archiving that repo and...