LANGUAGE_EXTS=$(perl -ne '$x=1 if /default-extensions:/?1:(/^[^-]/?0:$x); print "--ghc-opt -X$1 " if ($x && /^- (.+)/);' package-defaults.yaml)
[...]
ormolu [...] $LANGUAGE_EXTS [...]
... and various other hacks in our editor bindings.
I have very little insight into how feasible this would be, but it would be nice to have ormolu look at cabal file, package.yaml and all its imports, language extensions and options declared in the input file etc., and just always do the right thing.
I would be interested in any hints on how to do this, and any informed opinions on how hard it'd be. Still haven't decided what to do on https://zurihac.info this year. :)
We are currently doing this:
... and various other hacks in our editor bindings.
I have very little insight into how feasible this would be, but it would be nice to have ormolu look at cabal file, package.yaml and all its imports, language extensions and options declared in the input file etc., and just always do the right thing.
I would be interested in any hints on how to do this, and any informed opinions on how hard it'd be. Still haven't decided what to do on https://zurihac.info this year. :)