Closed Artturin closed 2 years ago
The corresponding attrset lambda patterns don't have an ellipsis ({ ... }:
). Deleting those identifiers changes code semantically, for example when used with eg. callPackage
. That's just an explanation why I chose to ignore them if the ellipsis is missing. This might need some more thought...
On the other hand there is already --no-lambda-pattern-names
so we could start ignoring the ellipsis altogether.
@supersandro2000 proposes that we should ignore attrset destructuring in absence of ...
when there is an { }@args
alias
@Artturin Do you have an opinion ignoring only when there's an @alias
to the lambda arg? That would replace the current check for ...
.
So far deadnix does what's intuitive for the language. I agree that we need to acknowledge the callPackage
practise in nixpkgs as it is very common.
@Artturin I have changed the behaviour to check all lambda attrset args. Could you please evaluate deadnix' main
branch, checking that it won't generate too many false positives?
I used it a couple of times in the last days and so far did not encounter any bugs. Maybe some more complex situations could be buggy but we can only test that if more people would use it.
i've been using it in my editor with https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#deadnix for ~3 days now and it has worked well
examples from https://github.com/NixOS/nixpkgs/pull/166605
./pkgs/applications/blockchains/bisq-desktop/default.nix
./pkgs/applications/audio/caudec/default.nix
gnutar was removed from bisq and bash from caudec