tweak(erlang): format w/ erlfmt instead of efmt
This commit is contained in:
parent
ed05e4c088
commit
ac1122ae67
3 changed files with 4 additions and 4 deletions
|
@ -40,7 +40,7 @@ This module requires Erlang be installed (which includes ~erlang-mode~). Check
|
|||
your distribution's package manager or a version management tool such as [[https://github.com/kerl/kerl][kerl]].
|
||||
|
||||
- [[https://github.com/erlang/sourcer][sourcer]] when [[doom-module::tools lsp]] & [[doom-module:+lsp]]
|
||||
- [[https://github.com/sile/efmt][efmt]] when [[doom-module::editor format]]
|
||||
- [[https://github.com/erlang/rebar3][rebar3]] with [[https://github.com/WhatsApp/erlfmt][erlfmt]] when [[doom-module::editor format]]
|
||||
|
||||
* TODO Usage
|
||||
#+begin_quote
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
:mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
|
||||
:mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode)
|
||||
:config
|
||||
(set-formatter! 'efmt '("efmt" "-") :modes '(erlang-mode))
|
||||
(set-formatter! 'erlfmt '("rebar3" "fmt" "-") :modes '(erlang-mode))
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'erlang-mode-local-vars-hook #'lsp! 'append))
|
||||
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
"This module requires (:tools lsp)")
|
||||
|
||||
(when (modulep! :editor format)
|
||||
(unless (executable-find "efmt")
|
||||
(warn! "Couldn't find efmt. Formatting will be disabled.")))
|
||||
(unless (and (executable-find "rebar3") (zerop (car (doom-call-process "rebar3" "fmt" "-v"))))
|
||||
(warn! "Couldn't find erlfmt. Formatting will be disabled.")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue