You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So for each %.hs file, it touches an empty dist/autoformat/%.hs_autoformat. And reformats only these files for which %.hs has time fresher than dist/autoformat/%.hs_autoformat.
Something like that would be very cool. ♥
The text was updated successfully, but these errors were encountered:
Neat approach, I assume the problem is how slow it is to run a format (it is indeed quite slow). Several things could be done to speed it up some, but I agree the best solution is to only run it on the files that actually might need it.
I would be open to including such logic in this tool if you'd like to send a PR :) but I'm not writing much Haskell lately so I probably won't be getting around to it personally anytime soon. I actually think such logic would be re-usable by other tools and would be great as a separate library.
Currently I enjoy having some plugins set up in my editor to run stylish-haskell on save and show suggestions from hlint and then manually run hfmt before check-in. For the Atom editor see ide-haskell.
Maybe we could have incremental formatting? I.e. when run for a directory, reformatting only the files with updated times (since last formatting)?
Here’s an example of how to do that with a plain old
Makefile
:https://github.com/michalrus/kornel/blob/5c99123afcbb04b555570093c0d5fad0cf7edf23/Makefile#L33-L41
So for each
%.hs
file, ittouch
es an emptydist/autoformat/%.hs_autoformat
. And reformats only these files for which%.hs
has time fresher thandist/autoformat/%.hs_autoformat
.Something like that would be very cool. ♥
The text was updated successfully, but these errors were encountered: