Support Fourmolu 0.7 in CLI mode

Fourmolu 0.7 (due to Ormolu 0.5) removes the `--cabal-default-extensions` flag, instead looking for Cabal files by default. If input is taken from stdin and `--stdin-input-file` isn't specified, it therefore fails.

We don't need to make any changes in non-CLI mode because the Cabal file handling logic occurs at a higher level outside the entry point we use to the library (the `ormolu` function).
This commit is contained in:
George Thomas 2022-06-12 15:59:49 +02:00
parent bb6b4e167a
commit 3d9f9a2889

View File

@ -66,7 +66,7 @@ provider plId ideState typ contents fp fo = withIndefiniteProgress title Cancell
(exitCode, out, err) <-
readCreateProcessWithExitCode
( proc "fourmolu" $
["-d"]
["-d", "--no-cabal"]
<> catMaybes
[ ("--start-line=" <>) . show <$> regionStartLine region
, ("--end-line=" <>) . show <$> regionEndLine region