nixpkgs-fmt
nixpkgs-fmt copied to clipboard
error: The argument '--explain' cannot be used with 'srcs'
Describe the bug What does this error mean? What is srcs? sources?
[davidak@gaming:~/code/nixpkgs]$ nixpkgs-fmt --explain pkgs/os-specific/linux/kbd/default.nix
error: The argument '--explain' cannot be used with 'srcs'
USAGE:
nixpkgs-fmt --explain
For more information try --help
Since the help is not enough here, it would be nice to have examples how to use the tool.
System information
nixpkgs-fmt 1.2.0
It seems like you can do something like:
nixpkgs-format --explain < file
but the output is pretty ugly, and I don't exactly understand how it's supposed to work.
It could probably work as long as there is only a single file passed to it.
I have a tree of nix files where running nixpkgs-fmt complains about 1/21 need being reformatted.
When I find . -type f -name \*.nix -exec bash -c "nixpkgs-fmt --explain < {}" \; I just get all files contents printed, i. e. nixpkgs-fmt seems to apply formatting regardless. There is no output telling me which rules are violated or none.
Also find . -type f -name \*.nix -exec bash -c "nixpkgs-fmt --check < {}" \; afterwards finds no errors anymore.