cachix / git-hooks.nix

Seamless integration of https://pre-commit.com git hooks with Nix.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrate with `nix fmt`

yajo opened this issue · 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.

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.

If someone makes a PR that would be great!