Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.editorconfig for Elixir projects
# EditorConfig is awesome: http://EditorConfig.org
# .editorconfig for Elixir projects
# https://git.io/elixir-editorconfig
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{md, markdown, eex}]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
#[*.bat]
#end_of_line = crlf
@christopheradams

This comment has been minimized.

Copy link

@christopheradams christopheradams commented Feb 3, 2017

What's the reason for not trimming trailing whitespace in markdown and eex files?

@christopheradams

This comment has been minimized.

Copy link

@christopheradams christopheradams commented Feb 3, 2017

Ok, I read up on some reasons for this, such as indented blank lines being OK (or needed) for some people, and some markdown flavors turning two trailing spaces into a carriage return (not sure about that one). For the Elixir Style Guide it should be true though, to enforce the same rule as the linter.

@christopheradams

This comment has been minimized.

Copy link

@christopheradams christopheradams commented Feb 3, 2017

I also wonder if it would be helpful for people learning Elixir to see all the file extensions that these rules apply to, rather than a [*] catch all. What do you think?

@eksperimental

This comment has been minimized.

Copy link
Owner Author

@eksperimental eksperimental commented Feb 4, 2017

regarding trailing white space it was that issue with the two trailing white-spaces and the carriage return.
We can change that for the Elixir Style guide.

I can't recall right now what was the reason why I have used it for eex files though.

I prefer to have a general rule that applies to everything, and if some files don't fit in those rule, exclude them, than the other way around. In simple words, it's easier to exclude than to include.

@eksperimental

This comment has been minimized.

Copy link
Owner Author

@eksperimental eksperimental commented Feb 4, 2017

@christopheradams do you have a proposal of an .editorconfig explicitly listing the file extensions? I would like to see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment