mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
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:
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user