haskell-template
haskell-template copied to clipboard
Add Githook for Code Formatting
Putting auto-formatting on a per commit basis would save the developer time resolving formatting issues due to failing CI.
Getting something like the following in a githook would suffice:
nix develop -c "treefmt"
I wouldn't enable it by default, but we can add documentation (linked from README.md) explaining to the user how to do it ... possibly based on:
- https://github.com/cachix/pre-commit-hooks.nix
- https://github.com/hercules-ci/pre-commit-hooks.nix/blob/flakeModule/flake-module.nix
Relevant: #36 (a nix check to make sure that source code was autoformatted).
Relevant: https://github.com/numtide/treefmt/issues/78
https://github.com/srid/haskell-flake/issues/136