turion / essence-of-live-coding

Universal Live Coding & Functional Reactive Programming Framework
https://www.manuelbaerenz.de/#computerscience
64 stars 6 forks source link

Dev fourmolu #106

Closed miguel-negrao closed 1 year ago

miguel-negrao commented 1 year ago

This PR is not for merging, just for discussion.

I've applied formolu v0.9.0.0 to the source code. I tried to pick all the options of fourmolu which were most similar to the code base here. There are still some differences such as { .. } being turned into {..}. @turion have a look at the code and see if you like it. It might be possible to tweak further the config file, but I didn't see anything else obvious.

This supersedes #101.

miguel-negrao commented 1 year ago

Build is failing. Have to check if this is caused by fourmolu...

turion commented 1 year ago

Thanks a lot!

Build is failing. Have to check if this is caused by fourmolu...

Indeed it is. It seems the issue is that fourmolu converts multiline haddocks to single line haddocks, and then chokes on the enumeration. Since the enumeration seems to be correctly rendering haddock, I'd leave it and instead configure fourmolu to use multiline.

miguel-negrao commented 1 year ago

function-arrows: trailing is the default, so I left that out. Check if I applied the correct settings. If we manage to get some settings that look ok it would be nice to have this, takes a bit of mental work of our shoulders :-) . If we want we can add a CI step to check that formatting is ok. It is building with cabal locally, let's see how it goes with the CI.

turion commented 1 year ago

If we want we can add a CI step to check that formatting is ok.

Yes, definitely! Ideally, every commit should go through the formatter.

miguel-negrao commented 1 year ago

I've added formatting checking to the CI. Not a single misplaced whitespace will get through ever again ! :-D

turion commented 1 year ago

Thanks a lot!