-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: Added .editorconfig file for basic encoding/indentation enforcement #2993
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All files seems a bit aggressive, no? Not better to do this on a per-file-category basis? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on whose comment? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yours ofcourse :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. \o/ |
||
|
||
[vcbuild.bat] | ||
end_of_line = crlf | ||
|
||
[*.{md,markdown}] | ||
trim_trailing_whitespace = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not trimming this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If that is the case, I am okay with that. @silverwind There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
|
||
[{lib,src,test}/**.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[src/**.{h,cc}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[test/*.py] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[configure] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
[{deps,tools}/**] | ||
indent_style = ignore | ||
indent_size = ignore | ||
end_of_line = ignore | ||
trim_trailing_whitespace = ignore | ||
charset = ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
.