Skip to content
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

Add support for .editorconfig file extension #6156

Merged
merged 1 commit into from
Nov 12, 2022
Merged

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Nov 7, 2022

Description

There appears to be ample usage of .editorconfig as a legitimate file extension, rather than a complete filename. This PR adds it as an extension to EditorConfig's language entry.

Sidenotes

My initial approach was this…

diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml
index ac5fe47d..5e7d9ea1 100644
--- a/lib/linguist/languages.yml
+++ b/lib/linguist/languages.yml
@@ -1675,8 +1675,6 @@ EditorConfig:
   group: INI
-  filenames:
+  extensions:
   - ".editorconfig"
   aliases:
   - editor-config
   ace_mode: ini

… however, test_samples.rb got confused by the EditorConfig sample named .editorconfig (which ostensibly doesn't equate to a filename containing only an extension):

  1) Failure:
TestSamples#test_ext_or_shebang [/Users/Alhadis/Forks/GitHub-Linguist/test/test_samples.rb:40]:
/Users/Alhadis/Forks/GitHub-Linguist/samples/EditorConfig/.editorconfig should have a file extension or a shebang, maybe it belongs in filenames/ subdir

1654 runs, 33562 assertions, 1 failures, 0 errors, 0 skips

@lildude, please let me know if this is correct behaviour; if so, I'll stick with the less-than-D.R.Y approach I resorted to for this PR. 😉

Checklist

@Alhadis Alhadis requested a review from a team as a code owner November 7, 2022 01:09
@lildude
Copy link
Member

lildude commented Nov 12, 2022

@lildude, please let me know if this is correct behaviour; if so, I'll stick with the less-than-D.R.Y approach I resorted to for this PR. 😉

Yup, I think it is. We already have other languages doing this.

@Alhadis Alhadis merged commit 5bbbf2f into master Nov 12, 2022
@Alhadis Alhadis deleted the editorconfig-extension branch November 12, 2022 14:11
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants