Closed Niols closed 1 year ago
First checks show that Ormolu and nixfmt hooks work fine, but not the hpack one, which is not that surprising considering. I will try to fix that in the next commits.
It turns out some of the .cabal
files were git-ignored but also committed. A very annoying practice that, right now, cost me quite a long debug session. Anyhow, things should be fixed now, I'll run a few more tests.
We'll get there.
New round of tests.
Tests successful! If you have a look at the flake checks, you'll see that every time I “break” one of the files, the CI complains, as expected. As soon as they are back in sync, CI is happy.
I just opened the PR https://github.com/cachix/pre-commit-hooks.nix/pull/236 that should bring this fixed version of the hpack
hook upstream. We will potentially iterate there on better versions but, eventually, we should settle things there. We can either wait for that to update the current PR or merge and update later on. Personally, I would go for the latter, especially considering that this PR introduces more than just the hpack
hook.
This PR actually does a bunch of things:
We introduce pre-commit-hooks in the flake, very similarly to how it works in tweag/pirouette.
We use pre-commit-hooks to replace the hand-crafted Ormolu/hpack checks. The new checks are much shorter to define and more generic. They also should give much cleaner and readable outputs.
We also use pre-commit-hooks to introduce actual pre-commit hooks for whoever is using the Nix environment.
We update the CI to run those checks in parallel from the rest. Once again, this is done very similarly to in Pirouette.
Finally, while I was at it, I normalised a bit the flake with respect to Pirouette's: the order of definitions, the name of variables, etc.