Proposal: Add option to mix format to create .formatter.exs

31 views
Skip to first unread message

eksperimental

unread,
Dec 13, 2020, 6:30:19 AM12/13/20
to elixir-l...@googlegroups.com
It happens that when I want to update a project that has been created
with an Elixir version prior to the introduction of the formatter,
I need to manually copy a .formatter.exs file. So I need to create a
new project and copy this file manually.

What I propose is to add an option called --create-formatter-file which
will create .formatter.exs only if this file does not exist.

Wojtek Mach

unread,
Dec 13, 2020, 6:50:40 AM12/13/20
to elixir-l...@googlegroups.com
I am slightly -1 given, as you mentioned, you can very easily achieve it today:

cd /path/to/project && mix new foo && mv foo/.formatter.exs . && rm -rf foo



> On 13 Dec 2020, at 12:30, eksperimental <eksper...@autistici.org> wrote:
>
> It happens that when I want to update a project that has been created
> --
> 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/5fd5fb46.1c69fb81.8380c.8e31SMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Allen Wyma

unread,
Dec 13, 2020, 8:54:00 PM12/13/20
to elixir-l...@googlegroups.com
I think we should add this in, actually. The formatter is part of mix. If there's a way to either auto-create, warn, or tell the user what to do to create the formatter, that would be great.

I think using the method suggested by Wojtek is a bit too much for newcomers, or even may make elixir sound not so great if the solution is to create a new project and copy and paste the formatter file then remove the newly created project.

Reply all
Reply to author
Forward
0 new messages