Add EditorConfig file and language sub-entry #4421
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a two-part PR related to the EditorConfig format, which I'll describe in ascending order of importance:
1. Language sub-entry
Recently, I took over maintainer duties for Atom's
editorconfig
package, which included a grammar for.editorconfig
files. Naturally, I couldn't help rewriting it to fix various errors in Atom's highlighting — I figure if there's a dedicated grammar for EditorConfig files, we might as well use it on GitHub too.I understand this might be pushing it, since the INI grammar provides decent-looking highlighting:
Visible differences to highlighting include file-globbing operators (like
**
and*
) and tokenisation of bracket-pairs embedded in[{section,titles}]
, which are EditorConfig-specific facets.2. Linguist's own
.editorconfig
fileI've added an EditorConfig for Linguist, so contributors with editors configured differently to GitHub's preferences (like myself 😝) can edit files without configuring their program to use a different tabstop-width or indentation style.
I should stress the addition of this file will not affect automation or tests in any way. It's strictly for the benefit of contributors, as it only changes what settings their editor of choice uses when hacking on Linguist.
Virtually every modern text-editor supports
.editorconfig
files either out-of-the-box or with a community-maintained plugin. Even GitHub acknowledges these files when determining what tab-width to use when displaying source code (albeit with various shortcomings, each of which I've reported at least twice now...)Checklist:
.editorconfig
: ~5,298,918 results.editorconfig