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 <radon@intuitiveexplanations.com>
This commit is contained in:
Ed Slocomb 2023-10-06 21:39:38 -07:00 committed by GitHub
parent 970b331171
commit afa0e54e43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 0 deletions

View file

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

View file

@ -57,6 +57,7 @@
(dart-format . ("dart" "format"))
(elm-format . ("elm-format" "--yes" "--stdin"))
(fish-indent . ("fish_indent"))
(fourmolu . ("fourmolu"))
(gawk . ("gawk" "-f" "-" "--pretty-print=-"))
(gofmt . ("gofmt"))
(gofumpt . ("gofumpt"))
@ -88,6 +89,7 @@
(nixfmt . ("nixfmt"))
(ocamlformat . ("ocamlformat" "-" "--name" filepath
"--enable-outside-detected-project"))
(ormolu . ("ormolu"))
(perltidy . ("perltidy" "--quiet" "--standard-error-output"))
(phpcs . ("apheleia-phpcs"))
(prettier

View file

@ -0,0 +1,4 @@
apt-get install -y haskell-platform
cabal update
cabal install fourmolu
cp "${HOME}/.cabal/bin/fourmolu" /usr/local/bin

View file

@ -0,0 +1,4 @@
apt-get install -y haskell-platform
cabal update
cabal install ormolu
cp "${HOME}/.cabal/bin/ormolu" /usr/local/bin

View file

@ -0,0 +1,10 @@
-- Foo performs foo and sometimes bar.
foo :: Thoroughness
-> Int -> Int
foo t x = if x > 20
then case t of
Thorough -> x + 50
Somewhat -> x + 20
NotAtAll -> 0
else 10 + 1

View file

@ -0,0 +1,13 @@
-- Foo performs foo and sometimes bar.
foo ::
Thoroughness ->
Int ->
Int
foo t x =
if x > 20
then case t of
Thorough -> x + 50
Somewhat -> x + 20
NotAtAll -> 0
else 10 + 1

View file

@ -0,0 +1,10 @@
-- Foo performs foo and sometimes bar.
foo :: Thoroughness
-> Int -> Int
foo t x = if x > 20
then case t of
Thorough -> x + 50
Somewhat -> x + 20
NotAtAll -> 0
else 10 + 1

View file

@ -0,0 +1,13 @@
-- Foo performs foo and sometimes bar.
foo ::
Thoroughness ->
Int ->
Int
foo t x =
if x > 20
then case t of
Thorough -> x + 50
Somewhat -> x + 20
NotAtAll -> 0
else 10 + 1