aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEllis KenyƑ <elken@users.noreply.github.com>2022-09-03 18:57:40 +0100
committerGitHub <noreply@github.com>2022-09-03 10:57:40 -0700
commit4d59a9b696385fe42d10c7eb822579e4f6a408a1 (patch)
tree39f894fbeb75fece64d62c8d92dd56a5c80b307f
parent04366a90dfc1063c4a22ea2e4ccaa48303a457e0 (diff)
Add elm-format (#100)
* feat: add elm-format * fix: master => main * Update elm-format.bash Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
-rw-r--r--CHANGELOG.md2
-rw-r--r--apheleia.el2
-rw-r--r--test/formatters/installers/elm-format.bash1
-rw-r--r--test/formatters/samplecode/elm-format/in.elm2
-rw-r--r--test/formatters/samplecode/elm-format/out.elm7
5 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcf1458..90b9f49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,10 +17,12 @@ The format is based on [Keep a Changelog].
(e.g. scalafmt), do not erase the buffer ([#116]).
### Formatters
+* [elm-format](https://github.com/avh4/elm-format) for Elm ([#100]).
* [bean-format](https://github.com/beancount/beancount) for Beancount
([#101]).
* [stylua](https://github.com/JohnnyMorganz/StyLua) for Lua ([#105]).
+[#100]: https://github.com/radian-software/apheleia/pull/100
[#101]: https://github.com/radian-software/apheleia/pull/101
[#105]: https://github.com/radian-software/apheleia/pull/105
[#109]: https://github.com/radian-software/apheleia/issues/109
diff --git a/apheleia.el b/apheleia.el
index 332499e..a0acc54 100644
--- a/apheleia.el
+++ b/apheleia.el
@@ -923,6 +923,7 @@ being run, for diagnostic purposes."
(brittany . ("brittany"))
(clang-format . ("clang-format"))
(dart-format . ("dart" "format"))
+ (elm-format . ("elm-format" "--yes" "--stdin"))
(fish-indent . ("fish_indent"))
(gofmt . ("gofmt"))
(google-java-format . ("google-java-format" "-"))
@@ -1056,6 +1057,7 @@ function: %s" command)))
(css-mode . prettier)
(dart-mode . dart-format)
(elixir-mode . mix-format)
+ (elm-mode . elm-format)
(fish-mode . fish-indent)
(go-mode . gofmt)
(haskell-mode . brittany)
diff --git a/test/formatters/installers/elm-format.bash b/test/formatters/installers/elm-format.bash
new file mode 100644
index 0000000..80a735c
--- /dev/null
+++ b/test/formatters/installers/elm-format.bash
@@ -0,0 +1 @@
+npm install -g elm-format
diff --git a/test/formatters/samplecode/elm-format/in.elm b/test/formatters/samplecode/elm-format/in.elm
new file mode 100644
index 0000000..b412781
--- /dev/null
+++ b/test/formatters/samplecode/elm-format/in.elm
@@ -0,0 +1,2 @@
+import Html exposing (text)
+main = text "Hello!"
diff --git a/test/formatters/samplecode/elm-format/out.elm b/test/formatters/samplecode/elm-format/out.elm
new file mode 100644
index 0000000..e7b9c6a
--- /dev/null
+++ b/test/formatters/samplecode/elm-format/out.elm
@@ -0,0 +1,7 @@
+module Main exposing (main)
+
+import Html exposing (text)
+
+
+main =
+ text "Hello!"