better fd command for formatting

This commit is contained in:
Gerg-L 2025-01-27 18:21:04 -05:00
parent 827928018a
commit 94c8616ea4
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI

View file

@ -14,13 +14,7 @@ writeShellApplication {
fd
];
text = ''
if [ -z "''${1:-""}" ] || [ "$1" == "." ]; then
fd '.*\.nix' . -x statix fix -- {} \;
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
else
statix fix -- "$1"
deadnix -e "$1"
nixfmt "$1"
fi
fd "$@" -t f -e nix -x statix fix -- '{}'
fd "$@" -t f -e nix -X deadnix -e -- '{}' \; -X nixfmt '{}'
'';
}