agda2hs icon indicating copy to clipboard operation
agda2hs copied to clipboard

Apply formatting and linting

Open dragospe opened this issue 1 year ago • 1 comments

Following some discussion at Zurihac, I wanted to give my take on the formatting/linting question.

This change will impact practically every file in the codebase, which can be difficult for contributors with open PRs. I've split up this PR into two separate commits:

  • 3f03d37: this is the commit that adds the formatting/linting utilities, and updates the Makefile with relevant commands and the README with some documentation
  • 01213d2: runs the make format and make lint commands. THIS BREAKS THINGS.

I'm marking this currently as draft, because there are a few things I still need to work out.

  • [ ] Add this to CI. Having formatting/linting goes out of sync quickly if its not enforced.
  • [ ] Determine what type(s) of breakage come from using these tools. Currently, all of the haskell compiles, but some of the tests don't run. This is may actually highlight some issues with Agda2hs itself, too; or it may just indicate that hlint/fourmolu/cabal-fmt don't work well with the generated code.

I think there was someone else who also had ideas here. Happy to chat and compare approaches -- the setup here is just my default when I'm starting new projects.

dragospe avatar Jun 08 '24 15:06 dragospe

..., though we could consider applying auto-formatting to the output of agda2hs when generating the Haskell code.

I do agree with this part, since, even though the formatting is generally quite decent, the formatting of the output from agda2hs can sometimes be fairly ugly, especially for things like large records or long type-lines.

anka-213 avatar Sep 22 '24 20:09 anka-213

I'm closing all stale draft PRs in this repository. Feel free to update and reopen if it is still relevant.

jespercockx avatar Sep 03 '25 08:09 jespercockx