Validate CodeMirror modes

This commit is contained in:
Joshua Peek
2016-09-23 14:47:49 -07:00
parent 0406a5b326
commit 855f1a1f86
5 changed files with 21 additions and 6 deletions

3
.gitmodules vendored
View File

@@ -791,3 +791,6 @@
[submodule "vendor/grammars/language-babel"]
path = vendor/grammars/language-babel
url = https://github.com/github-linguist/language-babel
[submodule "vendor/CodeMirror"]
path = vendor/CodeMirror
url = https://github.com/codemirror/CodeMirror

View File

@@ -402,6 +402,9 @@ module Linguist
# Public: Get CodeMirror mode
#
# Maps to a directory in the `mode/` source code.
# https://github.com/codemirror/CodeMirror/tree/master/mode
#
# Examples
#
# # => "nil"

View File

@@ -1083,7 +1083,7 @@ Ecere Projects:
- ".epj"
tm_scope: source.json
ace_mode: json
codemirror_mode: json
codemirror_mode: javascript
codemirror_mime_mode: application/json
language_id: 98
Eiffel:
@@ -1632,7 +1632,7 @@ HTML:
type: markup
tm_scope: text.html.basic
ace_mode: html
codemirror_mode: html
codemirror_mode: htmlembedded
codemirror_mime_mode: text/html
color: "#e44b23"
aliases:
@@ -2118,7 +2118,7 @@ KiCad:
Kit:
type: markup
ace_mode: html
codemirror_mode: html
codemirror_mode: htmlembedded
codemirror_mime_mode: text/html
extensions:
- ".kit"
@@ -2133,7 +2133,7 @@ Kotlin:
- ".kts"
tm_scope: source.Kotlin
ace_mode: text
codemirror_mode: kotlin
codemirror_mode: clike
codemirror_mime_mode: text/x-kotlin
language_id: 189
LFE:
@@ -2419,7 +2419,7 @@ MTML:
- ".mtml"
tm_scope: text.html.basic
ace_mode: html
codemirror_mode: html
codemirror_mode: htmlembedded
codemirror_mime_mode: text/html
language_id: 218
MUF:
@@ -4262,7 +4262,7 @@ TypeScript:
- ".tsx"
tm_scope: source.ts
ace_mode: typescript
codemirror_mode: typescript
codemirror_mode: javascript
codemirror_mime_mode: text/x-typescript
language_id: 378
Unified Parallel C:

View File

@@ -452,6 +452,14 @@ class TestLanguage < Minitest::Test
assert missing.empty?, message
end
def test_valid_codemirror_mode
Language.all.each do |language|
if mode = language.codemirror_mode
assert File.exist?(File.expand_path("../../vendor/CodeMirror/mode/#{mode}", __FILE__)), "#{mode} isn't a valid CodeMirror mode"
end
end
end
def test_all_popular_languages_exist
popular = YAML.load(File.read(File.expand_path("../../lib/linguist/popular.yml", __FILE__)))

1
vendor/CodeMirror vendored Submodule

Submodule vendor/CodeMirror added at 562e8eff5b