mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Test that languages have a type
This commit is contained in:
@@ -358,6 +358,15 @@ class TestLanguage < Minitest::Test
|
||||
assert missing.empty?, message
|
||||
end
|
||||
|
||||
def test_all_languages_have_type
|
||||
missing = Language.all.select { |language| language.type.nil? }
|
||||
message = "The following languages' types are not listed in grammars.yml. Please add types for all new languages.\n"
|
||||
|
||||
width = missing.map { |language| language.name.length }.max
|
||||
message << missing.map { |language| sprintf("%-#{width}s %s", language.name, language.tm_scope) }.sort.join("\n")
|
||||
assert missing.empty?, message
|
||||
end
|
||||
|
||||
def test_all_languages_have_a_valid_ace_mode
|
||||
ace_fixture_path = File.join('test', 'fixtures', 'ace_modes.json')
|
||||
skip("No ace_modes.json file") unless File.exist?(ace_fixture_path)
|
||||
|
||||
Reference in New Issue
Block a user