haskell-template icon indicating copy to clipboard operation
haskell-template copied to clipboard

Add Githook for Code Formatting

Open EvanPiro opened this issue 3 years ago • 4 comments

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"

EvanPiro avatar Aug 08 '22 03:08 EvanPiro

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

srid avatar Aug 08 '22 15:08 srid

Relevant: #36 (a nix check to make sure that source code was autoformatted).

srid avatar Aug 17 '22 18:08 srid

Relevant: https://github.com/numtide/treefmt/issues/78

srid avatar Mar 14 '23 16:03 srid

https://github.com/srid/haskell-flake/issues/136

srid avatar Jan 12 '24 17:01 srid