Remove samples/LANG/filenames as a source of truth (#4078)

All filenames must now be explicitly listed in languages.yml. A test
makes sure they are.
This commit is contained in:
Paul Chaignon
2018-04-02 11:09:06 +02:00
committed by GitHub
parent 718c9efaca
commit 0bf4b8a482
4 changed files with 50 additions and 8 deletions

View File

@@ -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__)