Proposal: Option to omit comments from generated mix projects

78 views
Skip to first unread message

Ville Hellman

unread,
Jan 18, 2018, 10:09:32 AM1/18/18
to elixir-lang-core
Hey all,

I'm proposing a new option for the `mix new` task: `--nocomments` when run with this option it would omit all comments from the generated project files.

When first starting with Elixir I found the comments in the files very useful indeed but more recently I've found them to be mostly a nuisance that I end up deleting straight away. This is particularly bad in the config file (of which most is comments) or in a Phoenix project. If this proposal is implemented I'm planning on opening similar proposal for the Phoenix project.

I would like to put together a pull request for this if the community agrees it would be a valuable addition.

I have had a preliminary look at the `Mix.Tasks.New` module and the work involved and would like to discuss couple of different approaches to how this could be implemented.

Thanks,
Ville

ps. congratulations to everyone involved in getting 1.6 released!

Kelvin Raffael Stinghen

unread,
Jan 18, 2018, 4:17:34 PM1/18/18
to elixir-l...@googlegroups.com
I’m 👍 about this!

Best,
Kelvin Stinghen
kelvin....@me.com

--
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/5e934651-f523-40fb-9fde-b98a088d2cc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arkadi...@erlang-solutions.com

unread,
Jan 19, 2018, 1:22:27 AM1/19/18
to elixir-lang-core
Same here, it would be great to have such option!

Onorio Catenacci

unread,
Jan 31, 2018, 3:49:42 PM1/31/18
to elixir-lang-core

What about doctests and other comments of that sort?  You would need some means to distinguish between those sorts of comments (which need to be left in) and those which should get removed.

 

Ville Hellman

unread,
Feb 1, 2018, 11:20:55 AM2/1/18
to elixir-lang-core
Hey Onorio,

Thanks for pointing it out. Looking at the generated files and the templates I can only see a single doctest that gets created: https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/tasks/new.ex#L443

To me this feels like a placeholder and for the --nocomments mode I'd propose not creating it either as anyone using this option is unlikely to keep it. Would you agree?

Thanks,
Ville

Onorio Catenacci

unread,
Feb 1, 2018, 3:29:26 PM2/1/18
to elixir-lang-core
I can see that I slightly misunderstood what you're proposing. I thought you were proposing removing comments after generation but you're proposing generating the boilerplate code without comments in the first place. So, never mind--I just misunderstood what you were proposing.

--
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/tLkMSdBybaI/unsubscribe.
To unsubscribe from this group and all its topics, 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/0dc69935-961a-4b71-b3dc-2725c3ee2272%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

pragdave

unread,
Feb 14, 2018, 2:19:04 PM2/14/18
to elixir-lang-core
✓👍

Ben Wilson

unread,
Feb 15, 2018, 9:34:28 AM2/15/18
to elixir-lang-core
I too would find this useful.
Reply all
Reply to author
Forward
0 new messages