Closed viraptor closed 1 year ago
Thanks for the PR and sorry for the tardy reply! Just a couple of comments:
insta
, this is the snapshot testing tool we usebin/tests/data
with the same name as the lint preferably, you can take a look at existing data for referencecargo insta test
, and accept new snapshots after confirming that the expected output is seenstatix.toml
file? if so, we should add such an option, you could add it to this PR, or a separate one if you'd like!do you think the threshold should be configurable using the statix.toml file?
There's no existing usage of something like that, right? I'd have to pass it to session like nix_version
is done currently?
this has been merged into master: ea0e5ee38eb6e3300f9cf0eba93793b8b29dfd01, don't see why github fails to detect and mark the PR. thanks for the contribution.
There's no existing usage of something like that, right? I'd have to pass it to session like nix_version is done currently?
you are right, but i think 3 is a reasonable default for now, so i'll leave it at that.
I feel that this is often undesirable in NixOS/nix-darwin/home-manager configurations, where you have lots of separate services.*
and programs.*
definitions; those are more namespace tags for sets of options than they are part of a coherent hierarchy, so I'm not sure services = { ... };
is really better. I do try to avoid this style outside of that kind of thing, though; maybe a special case or two wouldn't go amiss here? This lint accounts for 100% of the complaints statix has about my personal configuration flake.
Check for repeated keys in attrsets. For example:
should recommend creating a
The threshold for flagging is 3 repeats.
Since the warning doesn't really belong to a specific key, the location points at the whole AttrSet. It's possible to make it better with a precise suggestion, but it would be a lot of code. Maybe a todo for the future.