numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
269 stars 83 forks source link

Add dhall formatter #49

Closed srid closed 1 year ago

srid commented 1 year ago

https://github.com/dhall-lang/dhall-haskell/pull/137

It takes one file at a time in the command line, though. Is this mode supported by treefmt?

dhall format --inplace ./foo.dhall
zimbatm commented 1 year ago

You'll have to wrap it with a shell script that does something like this:

set -eu
for file in "$@"; do
  dhall format --inplace "$file"
done

Or fix upstream so it can take multiple files.

Per the formatter spec the formatter should also only write back the file if the content has changed.