tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

Recursively format directory #691

Closed brandon-leapyear closed 3 years ago

brandon-leapyear commented 3 years ago

Is your feature request related to a problem? Please describe. I would like to be able to format all Haskell files in a given directory, e.g. run on all files in my project like ormolu .

Describe the solution you'd like Ormolu should accept both files and directories. If a directory, recursively search for all .hs files, automatically excluding certain directories like .stack-work (which contains autogenerated haskell files), and (optionally) excluding additional files/directories passed in the command line.

Describe alternatives you've considered Currently, this can be done with

# all files in project
ormolu $(git ls-files '*.hs')

# all files in directory
ormolu $(git ls-files 'foo/**/*.hs')

but it would be nice to have this built-in, like hlint

Additional context Add any other context or screenshots about the feature request here.

mrkkrp commented 3 years ago

Closing, see #697.