Skip to content

Added .editorconfig file#698

Closed
AurelioDeRosa wants to merge 3 commits into
jquery:masterfrom
AurelioDeRosa:editorconfig
Closed

Added .editorconfig file#698
AurelioDeRosa wants to merge 3 commits into
jquery:masterfrom
AurelioDeRosa:editorconfig

Conversation

@AurelioDeRosa
Copy link
Copy Markdown
Member

.editorconfig file taken directly from jQuery's repository.

@scottgonzalez
Copy link
Copy Markdown
Member

@agcolom
Copy link
Copy Markdown
Member

agcolom commented Feb 24, 2016

@kswedberg Could you please have a look? I'm wondering whether we need an entry for each of package.json and *.yml to be set to two spaces?

@gnarf
Copy link
Copy Markdown
Member

gnarf commented Feb 24, 2016

If that's the spacing we are using for those files (and that is the spacing that npm uses for package.json) I would agree that we should add those to the .editorconfig

@agcolom
Copy link
Copy Markdown
Member

agcolom commented Feb 24, 2016

@gnarf Thank you very much for checking. @AurelioDeRosa would you be able to add this? Thank you so much!

@kswedberg
Copy link
Copy Markdown
Member

So, based on the OP and comments above, I think it might be a bit more "DRY" to do it like this:

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab

[**.json]
indent_style = space
indent_size = 2

[.*]
indent_style = space
indent_size = 2

Thoughts, @AurelioDeRosa , @scottgonzalez , @gnarf, anyone?

@AurelioDeRosa
Copy link
Copy Markdown
Member Author

I think we can combine the second and third sections and use:

[*.{json,yml}]
indent_style = space
indent_size = 2

@scottgonzalez
Copy link
Copy Markdown
Member

I would limit to package.json and *.yml. Other .json files use tabs.

@AurelioDeRosa
Copy link
Copy Markdown
Member Author

Something like?

[{package.json,*.yml}]

@gnarf
Copy link
Copy Markdown
Member

gnarf commented Feb 24, 2016

I think it's a lot clearer to just list the stuff twice for that... no reason to like not copy/pasta two lines of indent/size settings...

[package.json]
....

[*.yml]
....

feels a lot easier to understand at a glance than using the not as well known {a,b} glob syntax

@AurelioDeRosa
Copy link
Copy Markdown
Member Author

Fine @gnarf. So I'd say that the final file should be:

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab

[package.json]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

If everyone is happy, I'll make a final PR and then merge.

@kswedberg
Copy link
Copy Markdown
Member

LGTM! Thanks for sticking with this, @AurelioDeRosa .

@AurelioDeRosa
Copy link
Copy Markdown
Member Author

File updated. Any further comment @gnarf and @scottgonzalez?

@gnarf
Copy link
Copy Markdown
Member

gnarf commented Feb 26, 2016

👍

@AurelioDeRosa AurelioDeRosa deleted the editorconfig branch February 26, 2016 21:45
Krinkle pushed a commit that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants