Automate stylish haskell fixups
Clarification and motivation
It's often the case that some commits get pushed which accidentally don't respect our style guide, most often regarding the ordering of imports.
A good portion of the mistakes could be prevented by running stylish haskell, for which we already have a working configuration as well as a target in the top-level Makefile
: stylish
.
Checking this on CI is sure to be annoying, what we should do instead is running a script that pushes a fixup
commit when necessary.
Note that this is likely going to be similar to what is being implemented in !938 (closed) for cabal files, which is close to getting merged. As such, we should take as much as possible from that to avoid repeating the discussions/challenges/considerations that have already been handled there.
While it may be a bit improper in some cases, I believe we should only run this on the last commit in an MR, aka whichever the pipeline is triggered on.
It may happen that the commit pushed actually fixes mistakes pushed by a different commit than the one it fixup
s, but this isn't too bad IMO and is much simpler/faster to do.
Acceptance criteria
CI has a step
that pushes a fixup
to the latest commit in an MR when running make stylish
would create a diff.