zlacker

[parent] [thread] 1 comments
1. autarc+(OP)[view] [source] 2025-02-17 17:47:19
I wrote a tool in this space as well, precious (https://github.com/houseabsolute/precious). It's odd to me that these tools are often talked about with such a focus on Git hooks. Yes, that is definitely one use case, but I also want to run this sort of thing in CI to check PRs, and I _also_ want to run it locally to apply _pretty-printing_ to new code, rather than just having it check the code that I wrote.

I think hk does do all those things, but it's a bit obscured by the focus on Git hooks in the docs. But the docs are also still in a super early state, so maybe that will be fleshed out more in the future.

replies(1): >>srid+ho
2. srid+ho[view] [source] 2025-02-17 20:25:55
>>autarc+(OP)
I use https://github.com/cachix/git-hooks.nix which provides all of it:

- Pre-commit hook setup

- Run locally anytime (`pre-commit run -a`)

- Check in CI (as Nix flake check)

Example repo: https://github.com/srid/haskell-template

The pre-commit configuration: https://github.com/srid/haskell-template/blob/master/nix/mod...

[go to top]