Closed andyrichardson closed 3 years ago
Is your feature request related to a problem? Please describe. It would be great if formatting could optionally be written to files on execution.
Tools such as prettier and eslint take a --write or --fix argument to opt-in to writing to the file.
--write
--fix
Describe the solution you'd like
When running the following command
fmt --write flake.nix
The formatted file content would be written to the file rather than outputted to the console.
Describe alternatives you've considered
Maybe add something to the readme to make it easy for users to have this functionality (less ideal).
Something like (not tested)
find nix | grep .nix | xargs -L 1 -I {} bash -c "fmt {} > {}"
Additional context
N/A
This is already the default. Just use nixpkgs-fmt flake.nix
nixpkgs-fmt flake.nix
Thanks @zimbatm - looks like I was using fmt rather than nixpkgs-fmt
fmt
nixpkgs-fmt
Is your feature request related to a problem? Please describe. It would be great if formatting could optionally be written to files on execution.
Tools such as prettier and eslint take a
--write
or--fix
argument to opt-in to writing to the file.Describe the solution you'd like
When running the following command
The formatted file content would be written to the file rather than outputted to the console.
Describe alternatives you've considered
Maybe add something to the readme to make it easy for users to have this functionality (less ideal).
Something like (not tested)
Additional context
N/A