yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
76 stars 39 forks source link

WIP: Add hindent support and bash script #150

Open amitaibu opened 7 years ago

amitaibu commented 7 years ago

PR will add format files using hindent and will add a bash script to run it all on files.

Currently the bash script needs to exclude src/Settings.hs due to a known bug.

I've opened PR as work in progress, just to confirm it is a desired change. If so, I'll work on finalizing it.

The .haskell-ghc-mod.json is there to suppress errors in editors such as atom, that might get confused with multiple ghc installations.

snoyberg commented 7 years ago

I have two high-level concerns with doing this:

  1. A lot of diffs added to the codebase, not necessarily for great reasons. But I'm overall in favor of code style consistency, so I think I'd go along with it here.
  2. I'm not convinced that adding a script to each project is a good way to handle this. What about working on getting a command added to hindent to format a whole project?
amitaibu commented 7 years ago

What about working on getting a command added to hindent to format a whole project?

If I understand correctly hident is just a prettifier. That is, it doesn't deal at all with (re-)saving the files. Maybe we could add it as a stack command -- but I haven't done it yet, so not sure about the complexity.