Last active
August 21, 2022 12:14
-
-
Save eksperimental/6a43b9a0ab8d718f5886e7025062fcbd to your computer and use it in GitHub Desktop.
.editorconfig for Elixir projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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?
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.
@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
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.