tools: Added .editorconfig file for basic encoding/indentation enforcement#2993
tools: Added .editorconfig file for basic encoding/indentation enforcement#2993ronkorving wants to merge 1 commit intonodejs:masterfrom
Conversation
.editorconfig
Outdated
There was a problem hiding this comment.
I'd remove that comment
|
I'd add |
|
Why leave trailing whitespace in markdown files? |
|
That is an absolutely horrible syntax. But sure. |
ae3071b to
13215f4
Compare
There was a problem hiding this comment.
I'm personally confused as to when to use * and **. In the hello world style example on http://editorconfig.org they show [*] as a sort of default setting for all files, but they also explain how * does not include slashes. So wouldn't that mean that this rule will match only files in the root dir? That would be a very odd default, so I must be mistaken. I just can't find an explanation for it.
There was a problem hiding this comment.
That's the thing that confuses me too about editorconfig. I think * is fine for a catch-all, but you should double check if the correct files match with the CLI tool.
There was a problem hiding this comment.
@ronkorving this works because patterns without a slash are equivalent to **/pattern (essentially matching in the root directory and all child directories). If you need to match something specifically in the root, add an initial slash like /* (which will only match top-level files). We modeled this after the way globs work in .gitignore.
|
does atom editor care about that file? |
|
@reqshark if you install the plugin for it, it will |
|
cool |
|
@reqshark I'm using Atom too, and that's the primary reason for wanting to see a .editorconfig file included in the project (since it doesn't have "project settings" or anything, which in a way is actually great). |
.editorconfig
Outdated
There was a problem hiding this comment.
.py files have two space indent.
There was a problem hiding this comment.
Might as well put the 2-space indent into * and use sections for files that differ.
There was a problem hiding this comment.
+1. Can we match configure here as well?
There was a problem hiding this comment.
@jbergstroem configure's indentation is all over the place tbh, but I don't mind adding it.
2 space indent?
|
Another addition: |
.editorconfig
Outdated
There was a problem hiding this comment.
If you end up moving indent_size = 2 to *, can you add 8 here? (Ok, call me a unix beard but it's at least relatively default in make-land)
|
ping @ronkorving |
|
@silverwind perhaps *.bat should be CRLF? I've added that, but let me know if inappropriate or incomplete. |
1905416 to
3a7bc86
Compare
|
Hmm, not sure about that or if there even is a specific reason for CRLF in bat files, but we're somewhat inconsistent here thought most of these are in deps: |
|
Looks like we'd want to exclude |
|
Looks Would a line-ending conversion mess up git history? |
3a7bc86 to
e6c421d
Compare
|
I've changed *.bat to vcbuild.bat |
There was a problem hiding this comment.
Why not trimming this?
There was a problem hiding this comment.
Someone mentioned before that end of line spaces can be used to enforce white lines iirc. I'm not a fan of the practice, but I think the only alternative to that is introducing <br> tags into the content.
There was a problem hiding this comment.
If that is the case, I am okay with that. @silverwind
There was a problem hiding this comment.
Yes, trailing space to force a line break in markdown. Not a fan of it either, but we should leave that option available to collaborators.
|
Is it possible to exclude |
e6c421d to
73d8b68
Compare
|
@silverwind I'm not aware of any way to do this, especially in .editorconfig |
|
|
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default.
45704ac to
838b9cf
Compare
|
Prepended "tools: " ;) |
|
@ronkorving all lowercase in commit title please (unless you reference acronyms, variables, classes, etc). Also, keep it shorter than 51 characters. There's a commit style-guide here. |
|
We also usually write in the imperative form ("add" instead of "added") but it's not in the guide so I don't know if it's really a rule |
|
@targos its in the extended guide we link to. |
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default. PR-URL: #2993 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
|
Thanks! Landed in d63ccee with a conforming commit message. Please make sure to honor our commit message guidlines in the future. 😉 |
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default. PR-URL: #2993 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default. PR-URL: #2993 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default. PR-URL: #2993 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This helps editors (see http://editorconfig.org/#download) to apply the right indentation and encoding rules to files by default. PR-URL: nodejs#2993 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This helps editors (see http://editorconfig.org/#download) to apply the right indentation, end-of-line characters, and encoding rules to files of any type (extension) directly and without going through linters, etc. I can imagine some of the contents of this PR may need tweaking, so feedback is most appreciated.