Proposal: Use EditorConfig in the Elixir Project

142 views
Skip to first unread message

eksperimental

unread,
Feb 2, 2017, 12:45:07 PM2/2/17
to elixir-l...@googlegroups.com
Hi everyone,
I would like to propose to include a .editorconfig file in the Elixir project.
This is the file I have been using during the past year, and I'm very pleased with it, as it has
worked flawlessly so far.
https://git.io/elixir-editorconfig

For those who never heard of it, Editor Config (http://editorconfig.org/) consists of "of a file
format for defining coding styles and a collection of text editor plugins that enable editors to
read the file format and adhere to defined styles"

It is being used in many big projects:
https://github.com/editorconfig/editorconfig/wiki/Projects-Using-EditorConfig

It pretty much adheres to the conventions we have in the project, which is:
- No trailing white-space at the end of lines
- End file in a new line
- Use 2 white-spaces instead of tab
- file charset is UTF-8

Let me know what you think,
Additionally I recommend everyone to include it in your project, and send me your contributions,
maybe in the future it could also be included when you create a new project running Mix.

Cheers

Andrea Leopardi

unread,
Feb 2, 2017, 12:52:24 PM2/2/17
to elixir-l...@googlegroups.com
While it's a beautiful idea that I have supported for years, editorconfig is a tricky thing. The biggest drawback IMO is that it requires external editor integration (via plugin). I believe that if you're someone that cares enough about this stuff to go and install editorconfig support for your editor, than you probably already pay attention to stuff like trailing whitespace and already have your editor setup for that. Of course adding such a config file to the Elixir repo is not a huge deal, but it's something that we have to add, see in the file list, keep in the git history, explain what it is to users, and so on. I think a better approach could be to have a bot that reviews PRs and just checks for this kind of universal things (trailing whitespace, encoding), so that it would work even without contributors having editorconfig support in their editor and would not allow users to accidentally bypass editorconfig (we would still see the comments in the PR). But let's see how others feel about this :)

Andrea
> --
> 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/20170203004453.4e20355e.eksperimental%40autistici.org.
> For more options, visit https://groups.google.com/d/optout.

Chris McCord

unread,
Feb 2, 2017, 1:12:17 PM2/2/17
to elixir-l...@googlegroups.com
I agree with Andrea that the folks who care about these things will necessarily have their editors tuned to their liking. The folks who don’t likely won’t have it enabled or be aware of what’s going on. I’m definitely for pretty code and well configured editors, but personally -1 on including it :)
> To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/A5651D8C-5FA7-410A-ACC9-60B55413BC24%40gmail.com.

Jean Parpaillon

unread,
Feb 8, 2017, 5:22:15 AM2/8/17
to elixir-lang-core, eksper...@autistici.org
Hi,
I totally support the inclusion of editorconfig in the project.

I do not understand the reasons why not including it:
- requires external editor integration:
  - existing plugins list is huge: http://editorconfig.org/#download
  - If you don't want to use, don't use it ! If your editor already support editorconfig, then it's fine.
- "you probably already pay attention to stuff like this": ok, but we are just speaking about a tool making these things easier, with no drawbacks.

At the end, it is just a way of telling formally: here are the rules, and there are tools to help you writing nice code. What's the problem including it in the project ?

My 2c
Jean

José Valim

unread,
Feb 8, 2017, 6:00:35 AM2/8/17
to elixir-l...@googlegroups.com, eksper...@autistici.org
What's the problem including it in the project ?

The problems have already been outlined:

1. It is unclear how many people use editorconfig. I wouldn't add files to the project root unless it is beneficial to a large part of contributors

2. If editorconfig would only apply to few developers, we would prefer a mechanism that would be more generally applicable, such as a bot that review PRs which is more generally applicable (while they are not exclusive, a bot would likely require its own files as well, going back to point 1 above)

You may not agree with the conclusions but, from our point of view, that's why editorconfig is not that appealing.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
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-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0a3d2080-0803-4bf9-8011-141a8c74c8d3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages