mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge remote-tracking branch 'origin/master' into test-helper
* origin/master: (31 commits) Link to Lightshow in CONTRIBUTING.md Switch to a better F# grammar Bump Rugged again Checkout the master for testing Rugged 0.22.0b3 Reordering Bump version to 4.0.3 Add some docs for tm_scope Change NONE to none Checking other case for Chart.jS Test that all languages have grammars Fix RHTML's tm_scope Chart JS is vendored Switch to a better grammar for Bro reorder again… put cjsx at the top Use a SQF grammar for SQF files move cjsx before iced move cjsx before iced change component name ... Conflicts: test/test_language.rb
This commit is contained in:
@@ -292,6 +292,13 @@ class TestBlob < Test::Unit::TestCase
|
||||
assert blob("deps/http_parser/http_parser.c").vendored?
|
||||
assert blob("deps/v8/src/v8.h").vendored?
|
||||
|
||||
# Chart.js
|
||||
assert blob("some/vendored/path/Chart.js").vendored?
|
||||
assert !blob("some/vendored/path/chart.js").vendored?
|
||||
|
||||
# Codemirror deps
|
||||
assert blob("codemirror/mode/blah.js").vendored?
|
||||
|
||||
# Debian packaging
|
||||
assert blob("debian/cron.d").vendored?
|
||||
|
||||
|
||||
@@ -358,4 +358,15 @@ class TestLanguage < Test::Unit::TestCase
|
||||
def test_by_type
|
||||
assert !Language.by_type(:prose).nil?
|
||||
end
|
||||
|
||||
def test_all_languages_have_grammars
|
||||
scopes = YAML.load(File.read(File.expand_path("../../grammars.yml", __FILE__))).values.flatten
|
||||
missing = Language.all.reject { |language| language.tm_scope == "none" || scopes.include?(language.tm_scope) }
|
||||
message = "The following languages' scopes are not listed in grammars.yml. Please add grammars for all new languages.\n"
|
||||
message << "If no grammar exists for a language, mark the language with `tm_scope: none` in lib/linguist/languages.yml.\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
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user