Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mix-format for .heex files #304

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The format is based on [Keep a Changelog].
calling major-mode. Also includes setting for `indent-tabs-mode` ([#286]).
* [Formatter scripts](scripts/formatters) will now work on Windows if Emacs
can find the executable defined in the shebang.
* `.heex` files are now properly formatted ([#304]).

### Internal
* Major internal refactoring has occurred to make it possible to write
Expand All @@ -50,6 +51,7 @@ The format is based on [Keep a Changelog].
[#285]: https://github.com/radian-software/apheleia/issues/285
[#290]: https://github.com/radian-software/apheleia/pull/290
[#302]: https://github.com/radian-software/apheleia/issues/302
[#304]: https://github.com/radian-software/apheleia/pull/304

## 4.1 (released 2024-02-25)
### Enhancements
Expand Down
4 changes: 3 additions & 1 deletion apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
(ktlint . ("ktlint" "--log-level=none" "--stdin" "-F" "-"))
(latexindent . ("latexindent" "--logfile=/dev/null"))
(mix-format . ("apheleia-from-project-root"
".formatter.exs" "mix" "format" "-"))
".formatter.exs" "mix" "format"
"--stdin-filename" filepath "-"))
(nixfmt . ("nixfmt"))
(ocamlformat . ("ocamlformat" "-" "--name" filepath
"--enable-outside-detected-project"))
Expand Down Expand Up @@ -320,6 +321,7 @@ rather than using this system."
(graphql-mode . prettier-graphql)
(haskell-mode . brittany)
(hcl-mode . hclfmt)
(heex-ts-mode . mix-format)
(html-mode . prettier-html)
(html-ts-mode . prettier-html)
(java-mode . google-java-format)
Expand Down
2 changes: 2 additions & 0 deletions test/formatters/installers/mix-format.bash
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
add-apt-repository ppa:rabbitmq/rabbitmq-erlang
apt-get update -y
apt-get install -y elixir
6 changes: 6 additions & 0 deletions test/formatters/samplecode/mix-format/in.html.heex
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<.component id={ @a }>
<:slot attr={@b}
foo="bar">
<%= @c %>
</:slot>
</.component>
5 changes: 5 additions & 0 deletions test/formatters/samplecode/mix-format/out.html.heex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<.component id={@a}>
<:slot attr={@b} foo="bar">
<%= @c %>
</:slot>
</.component>
Loading