Proposal: mix format to work with EEx files

467 views
Skip to first unread message

Steven Blowers

unread,
Dec 29, 2017, 6:40:24 PM12/29/17
to elixir-lang-core
Hello,

Thanks to those involved for their recent work with mix format which I have been trying out on 1.6rc0.

I find myself now wanting to format everything in my current Phoenix project, including my EEx templates.

The formatter does not currently do this, I was wondering if would even be the correct decision for the formatter to also do EEx files,
as they are so different to a regular Elixir file and I should instead be looking for a HTML formatter which can handle embedded code in it?

The downside to that would then be setting up two formatters for one project, the second one most likely being setup with Node/NPM,
which I guess isn't so bad as most Phoenix projects already have Node/NPM to handle assets.

What are people's thoughts on this?

Steven

Louis Pilfold

unread,
Dec 29, 2017, 7:03:46 PM12/29/17
to elixir-lang-core

Hey

How would the formatter know what format to use for eex files? It's often HTML but there is no guarantee that is the case.

Cheers,
Louis


--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/8ffda124-215a-4dc0-8ed7-2b6fc57e1892%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Blowers

unread,
Dec 29, 2017, 7:23:47 PM12/29/17
to elixir-lang-core
Would matching the filename format to *.html.eex work?

Steven

José Valim

unread,
Dec 30, 2017, 12:45:41 PM12/30/17
to elixir-l...@googlegroups.com
It is certainly doable, but we would need to leave everything outside of <% ... %> untouched.

It is not in our plans to work on this feature though, so pull requests are appreciated!



José Valim
Founder and 
Director of R&D

To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2d8c519b-850f-4bdf-a695-4d21777ca15c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages