ormolu
ormolu copied to clipboard
CLI: Support specifying input folders in addition to just input files
It would be nice if fourmolu could take folders as well as files as an input and would process all haskell files in that folder (recursively) so instead of
fourmolu -i $(find src -name '*.hs')
I'd be able to do just
fourmolu -i src
This is consistent what formatters in other languages support and would be a nice quality of life improvement.
I dared to take a stab at this in https://github.com/tweag/ormolu/pull/911. Feedback welcome.
Thanks, but this is a duplicate of #691/#697.
In general, I think it is more composable to outsource listing files to another tool (find
, fd
, git ls-files
), rather than adding such functionality to Ormolu.
For more advanced usages and patterns I definitely agree. But supporting the basic case as the "all *.hs files in this directory" seems to be a better UX overall and something a lot of users (including me) would expect to work out of the box. Just my $0.02.
Closing as a duplicate of #691.