diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 53cc3682..13df0e75 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -539,14 +539,6 @@ module Linguist end end - if fns = filenames[name] - fns.each do |filename| - if !options['filenames'].include?(filename) - options['filenames'] << filename - end - end - end - Language.create( :name => name, :color => options['color'], diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index f1955868..32cb0952 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -239,6 +239,10 @@ ApacheConf: extensions: - ".apacheconf" - ".vhost" + filenames: + - ".htaccess" + - apache2.conf + - httpd.conf tm_scope: source.apache-config ace_mode: apache_conf language_id: 16 @@ -1467,6 +1471,8 @@ GN: - ".gni" interpreters: - gn + filenames: + - ".gn" tm_scope: source.gn ace_mode: python codemirror_mode: python @@ -1925,6 +1931,8 @@ INI: - ".pro" - ".properties" filenames: + - ".editorconfig" + - ".gitconfig" - buildozer.spec tm_scope: source.ini aliases: @@ -3226,6 +3234,7 @@ PHP: - ".phps" - ".phpt" filenames: + - ".php" - ".php_cs" - ".php_cs.dist" - Phakefile @@ -3370,6 +3379,7 @@ Perl: - ".psgi" - ".t" filenames: + - ack - cpanfile interpreters: - perl @@ -3709,6 +3719,7 @@ R: - ".rsx" filenames: - ".Rprofile" + - expr-dist interpreters: - Rscript ace_mode: r @@ -4035,6 +4046,7 @@ Ruby: - Berksfile - Brewfile - Buildfile + - Capfile - Dangerfile - Deliverfile - Fastfile @@ -4298,8 +4310,29 @@ Shell: - ".bash_logout" - ".bash_profile" - ".bashrc" + - ".cshrc" + - ".login" + - ".profile" + - ".zlogin" + - ".zlogout" + - ".zprofile" + - ".zshenv" + - ".zshrc" + - 9fs - PKGBUILD + - bash_logout + - bash_profile + - bashrc + - cshrc - gradlew + - login + - man + - profile + - zlogin + - zlogout + - zprofile + - zshenv + - zshrc interpreters: - ash - bash @@ -4568,6 +4601,9 @@ Tcl: - ".tcl" - ".adp" - ".tm" + filenames: + - owh + - starfield interpreters: - tclsh - wish @@ -4643,6 +4679,7 @@ Text: - ".no" filenames: - COPYING + - COPYING.regex - COPYRIGHT.regex - FONTLOG - INSTALL @@ -4657,6 +4694,7 @@ Text: - delete.me - keep.me - read.me + - readme.1st - test.me tm_scope: none ace_mode: text @@ -4844,6 +4882,7 @@ Vim script: extensions: - ".vim" filenames: + - ".gvimrc" - ".nvimrc" - ".vimrc" - _vimrc @@ -5082,6 +5121,7 @@ XML: - ".zcml" filenames: - ".classpath" + - ".cproject" - ".project" - App.config - NuGet.config @@ -5190,6 +5230,7 @@ YAML: filenames: - ".clang-format" - ".clang-tidy" + - ".gemrc" ace_mode: yaml codemirror_mode: yaml codemirror_mime_type: text/x-yaml diff --git a/samples/C/filenames/script b/samples/C/script similarity index 100% rename from samples/C/filenames/script rename to samples/C/script diff --git a/test/test_samples.rb b/test/test_samples.rb index 0a357da5..002af218 100644 --- a/test/test_samples.rb +++ b/test/test_samples.rb @@ -42,6 +42,15 @@ class TestSamples < Minitest::Test end end + def test_filename_listed + Samples.each do |sample| + if sample[:filename] + listed_filenames = Language[sample[:language]].filenames + assert_includes listed_filenames, sample[:filename], "#{sample[:path]} isn't listed as a filename for #{sample[:language]} in languages.yml" + end + end + end + # Check that there aren't samples with extensions or interpreters that # aren't explicitly defined in languages.yml languages_yml = File.expand_path("../../lib/linguist/languages.yml", __FILE__)