mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
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:
parent
970b331171
commit
afa0e54e43
8 changed files with 58 additions and 0 deletions
|
@ -43,7 +43,9 @@ The format is based on [Keep a Changelog].
|
||||||
for [Bazel Build](https://bazel.build/) ([#171]).
|
for [Bazel Build](https://bazel.build/) ([#171]).
|
||||||
* [`cmake-format`](https://github.com/cheshirekow/cmake_format)
|
* [`cmake-format`](https://github.com/cheshirekow/cmake_format)
|
||||||
for [CMake](https://cmake.org/) ([#172]).
|
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]).
|
* [`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
|
* [`perltidy`](https://perltidy.sourceforge.net/) for
|
||||||
[perl](https://www.perl.org/) ([#175]).
|
[perl](https://www.perl.org/) ([#175]).
|
||||||
* [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]).
|
* [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]).
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
(dart-format . ("dart" "format"))
|
(dart-format . ("dart" "format"))
|
||||||
(elm-format . ("elm-format" "--yes" "--stdin"))
|
(elm-format . ("elm-format" "--yes" "--stdin"))
|
||||||
(fish-indent . ("fish_indent"))
|
(fish-indent . ("fish_indent"))
|
||||||
|
(fourmolu . ("fourmolu"))
|
||||||
(gawk . ("gawk" "-f" "-" "--pretty-print=-"))
|
(gawk . ("gawk" "-f" "-" "--pretty-print=-"))
|
||||||
(gofmt . ("gofmt"))
|
(gofmt . ("gofmt"))
|
||||||
(gofumpt . ("gofumpt"))
|
(gofumpt . ("gofumpt"))
|
||||||
|
@ -88,6 +89,7 @@
|
||||||
(nixfmt . ("nixfmt"))
|
(nixfmt . ("nixfmt"))
|
||||||
(ocamlformat . ("ocamlformat" "-" "--name" filepath
|
(ocamlformat . ("ocamlformat" "-" "--name" filepath
|
||||||
"--enable-outside-detected-project"))
|
"--enable-outside-detected-project"))
|
||||||
|
(ormolu . ("ormolu"))
|
||||||
(perltidy . ("perltidy" "--quiet" "--standard-error-output"))
|
(perltidy . ("perltidy" "--quiet" "--standard-error-output"))
|
||||||
(phpcs . ("apheleia-phpcs"))
|
(phpcs . ("apheleia-phpcs"))
|
||||||
(prettier
|
(prettier
|
||||||
|
|
4
test/formatters/installers/fourmolu.bash
Normal file
4
test/formatters/installers/fourmolu.bash
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apt-get install -y haskell-platform
|
||||||
|
cabal update
|
||||||
|
cabal install fourmolu
|
||||||
|
cp "${HOME}/.cabal/bin/fourmolu" /usr/local/bin
|
4
test/formatters/installers/ormolu.bash
Normal file
4
test/formatters/installers/ormolu.bash
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apt-get install -y haskell-platform
|
||||||
|
cabal update
|
||||||
|
cabal install ormolu
|
||||||
|
cp "${HOME}/.cabal/bin/ormolu" /usr/local/bin
|
10
test/formatters/samplecode/fourmolu/in.hs
Normal file
10
test/formatters/samplecode/fourmolu/in.hs
Normal 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
|
13
test/formatters/samplecode/fourmolu/out.hs
Normal file
13
test/formatters/samplecode/fourmolu/out.hs
Normal 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
|
10
test/formatters/samplecode/ormolu/in.hs
Normal file
10
test/formatters/samplecode/ormolu/in.hs
Normal 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
|
13
test/formatters/samplecode/ormolu/out.hs
Normal file
13
test/formatters/samplecode/ormolu/out.hs
Normal 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
|
Loading…
Add table
Reference in a new issue