Skip to content

Commit afa0e54

Browse files
edslocombraxod502
andauthored
Add ormolu and fourmolu, remove brittany (#221)
Found while trying to `make fmt-build` that the installer for `brittany` was broken, and couldn't fix it. This removes brittany, and adds the ormolu and fourmolu formatters for haskell, and sets ormolu as the default for haskell-mode. --------- Co-authored-by: Radon Rosborough <[email protected]>
1 parent 970b331 commit afa0e54

File tree

8 files changed

+58
-0
lines changed

8 files changed

+58
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ The format is based on [Keep a Changelog].
4343
for [Bazel Build](https://bazel.build/) ([#171]).
4444
* [`cmake-format`](https://github.com/cheshirekow/cmake_format)
4545
for [CMake](https://cmake.org/) ([#172]).
46+
* [`fourmolu`](https://github.com/fourmolu/fourmolu) for haskell
4647
* [`html-tidy`](https://www.html-tidy.org/) for HTML/XML ([#173]).
48+
* [`ormolu`](https://github.com/tweag/ormolu) for haskell.
4749
* [`perltidy`](https://perltidy.sourceforge.net/) for
4850
[perl](https://www.perl.org/) ([#175]).
4951
* [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]).

apheleia.el

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
(dart-format . ("dart" "format"))
5858
(elm-format . ("elm-format" "--yes" "--stdin"))
5959
(fish-indent . ("fish_indent"))
60+
(fourmolu . ("fourmolu"))
6061
(gawk . ("gawk" "-f" "-" "--pretty-print=-"))
6162
(gofmt . ("gofmt"))
6263
(gofumpt . ("gofumpt"))
@@ -88,6 +89,7 @@
8889
(nixfmt . ("nixfmt"))
8990
(ocamlformat . ("ocamlformat" "-" "--name" filepath
9091
"--enable-outside-detected-project"))
92+
(ormolu . ("ormolu"))
9193
(perltidy . ("perltidy" "--quiet" "--standard-error-output"))
9294
(phpcs . ("apheleia-phpcs"))
9395
(prettier
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apt-get install -y haskell-platform
2+
cabal update
3+
cabal install fourmolu
4+
cp "${HOME}/.cabal/bin/fourmolu" /usr/local/bin
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apt-get install -y haskell-platform
2+
cabal update
3+
cabal install ormolu
4+
cp "${HOME}/.cabal/bin/ormolu" /usr/local/bin
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Foo performs foo and sometimes bar.
2+
3+
foo :: Thoroughness
4+
-> Int -> Int
5+
foo t x = if x > 20
6+
then case t of
7+
Thorough -> x + 50
8+
Somewhat -> x + 20
9+
NotAtAll -> 0
10+
else 10 + 1
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Foo performs foo and sometimes bar.
2+
3+
foo ::
4+
Thoroughness ->
5+
Int ->
6+
Int
7+
foo t x =
8+
if x > 20
9+
then case t of
10+
Thorough -> x + 50
11+
Somewhat -> x + 20
12+
NotAtAll -> 0
13+
else 10 + 1
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Foo performs foo and sometimes bar.
2+
3+
foo :: Thoroughness
4+
-> Int -> Int
5+
foo t x = if x > 20
6+
then case t of
7+
Thorough -> x + 50
8+
Somewhat -> x + 20
9+
NotAtAll -> 0
10+
else 10 + 1
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Foo performs foo and sometimes bar.
2+
3+
foo ::
4+
Thoroughness ->
5+
Int ->
6+
Int
7+
foo t x =
8+
if x > 20
9+
then case t of
10+
Thorough -> x + 50
11+
Somewhat -> x + 20
12+
NotAtAll -> 0
13+
else 10 + 1

0 commit comments

Comments
 (0)