When I ran it on some of my nix files, I noticed that the lint W03 (Assignment instead of inherit) sometimes recommends to inherit when it is not possible.
For example running statix check on
let
foo = "value";
in
{
foo.bar = foo;
}
results in a warning
[W03] Warning: Assignment instead of inherit
╭─[test.nix:5:3]
│
5 │ foo.bar = foo;
· ───────┬──────
· ╰──────── This assignment is better written with inherit
───╯
and statix fix changes it to
let
foo = "value";
in
{
inherit foo;
}
However, the evaluation of those two files is not the same:
First, thanks for the nice tool!
When I ran it on some of my nix files, I noticed that the lint W03 (Assignment instead of inherit) sometimes recommends to inherit when it is not possible.
For example running
statix check
onresults in a warning
and
statix fix
changes it toHowever, the evaluation of those two files is not the same:
This does not happen when the variable name to be inherited (in this example
foo
) is not the first token (e.g. inbaz.foo.bar = foo;
).