Closed chshersh closed 2 years ago
I'll have a go at this
I see 3 possible ways to do this:
Any preference?
That's a difficult question to answer 😅
Now I'm not even sure how to do this properly 🤔 In the future, pre-commit hooks will run tools like hlint
and fourmolu
. This means, the environment needs to install them somehow and this might be a bit involved.
We also have a job for running HLint on CI so we don't need duplication. Not sure if it makes sense to combine them under the single pre-commit umbrella or keep them separate 🤔 I'd love to avoid job duplication.
my understanding is that pre-commit installs the required tools automatically, so that wouldn't be a problem . We might have to create our own plugins if they don't exist already
I did consider adding this to say the cabal workflow but would run once per architecture, which seems overkill. As of pre-commit, my understanding is that to add hlint and formolou in pre-commit is only a matter of setting it in .pre-commit-config.yaml If you mean running it in regular pre-commit but not in CI, I think it's possible setting separate sections in the same file.
Not too sure, never heard about pre-commit until doing this
I think I'm closing this issue without adding pre-commit hooks to CI with the following reasoning:
pre-commit
setup.nix-shell
and use it consistently on both CI and locally to avoid version mismatches. This is going to be a lot of work.fourmolu
anyway so pre-commit
won't bring much to the table.@marcellourbani Thanks for providing all the options and participating in the discussion! It really helped me to understand the desired workflow 🙂
I've also created a separate issue to add HLint as a pre-commit hook:
Even if we can't guarantee the same version as on CI, I believe it's still useful. HLint doesn't break behaviour too often.
To enforce that they're actually used.