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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.