aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadon Rosborough <radon@intuitiveexplanations.com>2024-09-21 19:54:44 -0700
committerGitHub <noreply@github.com>2024-09-21 19:54:44 -0700
commit9343b86f7c6c51866bb9e682dbc9c3233748aecc (patch)
tree2c9bbf9b6d7e227a83b1d0120560fa2e3509645b
parent25730686a3ca95de7b516e0f7651807c07d58340 (diff)
[#312] Fix Ormolu installation and invocation (#321)
Closes #312. The installation script was failing due to some Cabal bullshit that I don't even want to know the reason for, probably triggered by new package versions coming available, so I switched to upstream binaries. Applied the suggested fix from #312 for a new command-line option which has become required. Also set Ormolu as the default Haskell formatter instead of Brittany because that is what the Brittany dev recommends (see again #312).
-rw-r--r--CHANGELOG.md4
-rw-r--r--apheleia-formatters.el4
-rw-r--r--test/formatters/installers/ormolu.bash7
3 files changed, 9 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42a478a..bce8fbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,12 +25,16 @@ The format is based on [Keep a Changelog].
* `apheleia-npx` was sometimes not able to find formatters in a Yarn
PnP project if there was also a `node_modules` folder at the root of
the project ([#301]).
+* Ormolu is now passed the `--stdin-input-file` argument, which has
+ become required ([#312]).
## Internal
* Improvements to formatter test framework, it is now possible to
write tests that have additional data files ([#301]).
[#301]: https://github.com/radian-software/apheleia/pull/301
+[#306]: https://github.com/radian-software/apheleia/pull/306
+[#312]: https://github.com/radian-software/apheleia/issues/312
[#313]: https://github.com/radian-software/apheleia/pull/313
[#316]: https://github.com/radian-software/apheleia/pull/316
[#317]: https://github.com/radian-software/apheleia/issues/317
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index 5578398..2446d12 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -96,7 +96,7 @@
(ocamlformat . ("ocamlformat" "-" "--name" filepath
"--enable-outside-detected-project"))
(ocp-indent . ("ocp-indent"))
- (ormolu . ("ormolu"))
+ (ormolu . ("ormolu" "--stdin-input-file" filepath))
(perltidy . ("perltidy" "--quiet" "--standard-error-output"
(apheleia-formatters-indent "-t" "-i")
(apheleia-formatters-fill-column "-l")))
@@ -320,7 +320,7 @@ rather than using this system."
(go-mode . gofmt)
(go-ts-mode . gofmt)
(graphql-mode . prettier-graphql)
- (haskell-mode . brittany)
+ (haskell-mode . ormolu)
(hcl-mode . hclfmt)
(html-mode . prettier-html)
(html-ts-mode . prettier-html)
diff --git a/test/formatters/installers/ormolu.bash b/test/formatters/installers/ormolu.bash
index db6c4d4..3137856 100644
--- a/test/formatters/installers/ormolu.bash
+++ b/test/formatters/installers/ormolu.bash
@@ -1,4 +1,3 @@
-apt-get install -y ghc cabal-install
-cabal v2-update
-cabal v2-install ormolu --reorder-goals
-cp "${HOME}/.cabal/bin/ormolu" /usr/local/bin
+wget -nv https://github.com/tweag/ormolu/releases/download/0.7.7.0/ormolu-x86_64-linux.zip -O ormolu.zip
+unzip ormolu.zip
+cp ormolu /usr/local/bin/