git-hooks.nix icon indicating copy to clipboard operation
git-hooks.nix copied to clipboard

Integrate with `nix fmt`

Open yajo opened this issue 2 years ago • 2 comments

As you can see in the manual, there's a nix fmt option for flakes. Flakes can indicate what program should be used for formatting code. Flakes that use this project will usually be formatted using it, so I think it would be helpful to provide formatter configuration out of the box when using the flake template. Also documenting how to use it for projects that already have a flake.

yajo avatar Apr 24 '23 09:04 yajo

This is much needed option, because - while the corrected formatting gets applied to staged changes - there's no way to apply formatting to all tracked files.

EDIT: its there at pre-commit run --all-files. The integration with nix fmt would be cool nevertheless.

zmrocze avatar Apr 24 '23 17:04 zmrocze

If someone makes a PR that would be great!

domenkozar avatar Jul 29 '23 10:07 domenkozar