mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-09-24 00:32:12 +00:00
Merge remote-tracking branch 'origin/master' into interpreters-in-samples
* origin/master: (30 commits) Add byebug 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 ... Conflicts: lib/linguist/languages.yml
This commit is contained in:
@@ -2,6 +2,7 @@ before_install:
|
|||||||
- git fetch origin master:master
|
- git fetch origin master:master
|
||||||
- git fetch origin v2.0.0:v2.0.0
|
- git fetch origin v2.0.0:v2.0.0
|
||||||
- git fetch origin test/attributes:test/attributes
|
- git fetch origin test/attributes:test/attributes
|
||||||
|
- git fetch origin test/master:test/master
|
||||||
- sudo apt-get install libicu-dev -y
|
- sudo apt-get install libicu-dev -y
|
||||||
rvm:
|
rvm:
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ This can usually be solved either by adding a new filename or file name extensio
|
|||||||
|
|
||||||
Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream.
|
Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream.
|
||||||
|
|
||||||
You can also try to fix the bug yourself and submit a Pull Request. [This piece from TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars.
|
You can also try to fix the bug yourself and submit a Pull Request. [This piece from TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://lightshow.githubapp.com).
|
||||||
|
|
||||||
Once the bug has been fixed upstream, please let us know and we'll pick it up for GitHub.
|
Once the bug has been fixed upstream, please let us know and we'll pick it up for GitHub.
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
|
|||||||
gemspec :name => "github-linguist"
|
gemspec :name => "github-linguist"
|
||||||
gemspec :name => "github-linguist-grammars"
|
gemspec :name => "github-linguist-grammars"
|
||||||
gem 'test-unit', require: false if RUBY_VERSION >= '2.2'
|
gem 'test-unit', require: false if RUBY_VERSION >= '2.2'
|
||||||
|
gem 'byebug'
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|||||||
s.add_dependency 'charlock_holmes', '~> 0.7.3'
|
s.add_dependency 'charlock_holmes', '~> 0.7.3'
|
||||||
s.add_dependency 'escape_utils', '~> 1.0.1'
|
s.add_dependency 'escape_utils', '~> 1.0.1'
|
||||||
s.add_dependency 'mime-types', '>= 1.19'
|
s.add_dependency 'mime-types', '>= 1.19'
|
||||||
s.add_dependency 'rugged', '~> 0.22.0b1'
|
s.add_dependency 'rugged', '~> 0.22.0b4'
|
||||||
|
|
||||||
s.add_development_dependency 'mocha'
|
s.add_development_dependency 'mocha'
|
||||||
s.add_development_dependency 'pry'
|
s.add_development_dependency 'pry'
|
||||||
|
|||||||
+6
-5
@@ -5,8 +5,6 @@ http://svn.textmate.org/trunk/Review/Bundles/BlitzMax.tmbundle:
|
|||||||
- source.blitzmax
|
- source.blitzmax
|
||||||
http://svn.textmate.org/trunk/Review/Bundles/Cython.tmbundle:
|
http://svn.textmate.org/trunk/Review/Bundles/Cython.tmbundle:
|
||||||
- source.cython
|
- source.cython
|
||||||
http://svn.textmate.org/trunk/Review/Bundles/F%20Sharp.tmbundle:
|
|
||||||
- source.fsharp
|
|
||||||
http://svn.textmate.org/trunk/Review/Bundles/Forth.tmbundle:
|
http://svn.textmate.org/trunk/Review/Bundles/Forth.tmbundle:
|
||||||
- source.forth
|
- source.forth
|
||||||
http://svn.textmate.org/trunk/Review/Bundles/Parrot.tmbundle:
|
http://svn.textmate.org/trunk/Review/Bundles/Parrot.tmbundle:
|
||||||
@@ -38,6 +36,8 @@ https://github.com/Drako/SublimeBrainfuck/raw/master/Brainfuck.tmLanguage:
|
|||||||
- source.bf
|
- source.bf
|
||||||
https://github.com/JohnNilsson/awk-sublime/raw/master/AWK.tmLanguage:
|
https://github.com/JohnNilsson/awk-sublime/raw/master/AWK.tmLanguage:
|
||||||
- source.awk
|
- source.awk
|
||||||
|
https://github.com/JonBons/Sublime-SQF-Language:
|
||||||
|
- source.sqf
|
||||||
https://github.com/MarioRicalde/SCSS.tmbundle:
|
https://github.com/MarioRicalde/SCSS.tmbundle:
|
||||||
- source.scss
|
- source.scss
|
||||||
https://github.com/Oldes/Sublime-REBOL:
|
https://github.com/Oldes/Sublime-REBOL:
|
||||||
@@ -97,6 +97,8 @@ https://github.com/bholt/chapel-tmbundle:
|
|||||||
- source.chapel
|
- source.chapel
|
||||||
https://github.com/brandonwamboldt/sublime-nginx:
|
https://github.com/brandonwamboldt/sublime-nginx:
|
||||||
- source.nginx
|
- source.nginx
|
||||||
|
https://github.com/bro/bro-sublime:
|
||||||
|
- source.bro
|
||||||
https://github.com/carsonoid/sublime_man_page_support/raw/master/man-groff.tmLanguage:
|
https://github.com/carsonoid/sublime_man_page_support/raw/master/man-groff.tmLanguage:
|
||||||
- text.groff
|
- text.groff
|
||||||
https://github.com/ccreutzig/sublime-MuPAD:
|
https://github.com/ccreutzig/sublime-MuPAD:
|
||||||
@@ -131,6 +133,8 @@ https://github.com/euler0/sublime-glsl/raw/master/GLSL.tmLanguage:
|
|||||||
- source.glsl
|
- source.glsl
|
||||||
https://github.com/fancy-lang/fancy-tmbundle:
|
https://github.com/fancy-lang/fancy-tmbundle:
|
||||||
- source.fancy
|
- source.fancy
|
||||||
|
https://github.com/fsharp/fsharpbinding:
|
||||||
|
- source.fsharp
|
||||||
https://github.com/gingerbeardman/monkey.tmbundle:
|
https://github.com/gingerbeardman/monkey.tmbundle:
|
||||||
- source.monkey
|
- source.monkey
|
||||||
https://github.com/guillermooo/dart-sublime-bundle/raw/master/Dart.tmLanguage:
|
https://github.com/guillermooo/dart-sublime-bundle/raw/master/Dart.tmLanguage:
|
||||||
@@ -215,9 +219,6 @@ https://github.com/slavapestov/factor/raw/master/misc/Factor.tmbundle/Syntaxes/F
|
|||||||
- source.factor
|
- source.factor
|
||||||
https://github.com/slim-template/ruby-slim.tmbundle:
|
https://github.com/slim-template/ruby-slim.tmbundle:
|
||||||
- text.slim
|
- text.slim
|
||||||
https://github.com/smiledawgg/Bro.tmbundle:
|
|
||||||
- source.bro
|
|
||||||
- source.bro.sig
|
|
||||||
https://github.com/staltz/SublimeXtend:
|
https://github.com/staltz/SublimeXtend:
|
||||||
- source.xtend
|
- source.xtend
|
||||||
https://github.com/statatmbundle/Stata.tmbundle:
|
https://github.com/statatmbundle/Stata.tmbundle:
|
||||||
|
|||||||
@@ -57,14 +57,20 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns a String.
|
# Returns a String.
|
||||||
def extension
|
def extension
|
||||||
# File.extname returns nil if the filename is an extension.
|
extensions.last || ""
|
||||||
extension = File.extname(name)
|
end
|
||||||
basename = File.basename(name)
|
|
||||||
# Checks if the filename is an extension.
|
# Public: Return an array of the file extensions
|
||||||
if extension.empty? && basename[0] == "."
|
#
|
||||||
basename
|
# >> Linguist::FileBlob.new("app/views/things/index.html.erb").extensions
|
||||||
else
|
# => [".html.erb", ".erb"]
|
||||||
extension
|
#
|
||||||
|
# Returns an Array
|
||||||
|
def extensions
|
||||||
|
basename, *segments = File.basename(name).split(".")
|
||||||
|
|
||||||
|
segments.map.with_index do |segment, index|
|
||||||
|
"." + segments[index..-1].join(".")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ module Linguist
|
|||||||
# A bit of an elegant hack. If the file is executable but extensionless,
|
# A bit of an elegant hack. If the file is executable but extensionless,
|
||||||
# append a "magic" extension so it can be classified with other
|
# append a "magic" extension so it can be classified with other
|
||||||
# languages that have shebang scripts.
|
# languages that have shebang scripts.
|
||||||
extension = FileBlob.new(name).extension
|
extensions = FileBlob.new(name).extensions
|
||||||
if extension.empty? && blob.mode && (blob.mode.to_i(8) & 05) == 05
|
if extensions.empty? && blob.mode && (blob.mode.to_i(8) & 05) == 05
|
||||||
name += ".script!"
|
name += ".script!"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -190,8 +190,13 @@ module Linguist
|
|||||||
# Returns all matching Languages or [] if none were found.
|
# Returns all matching Languages or [] if none were found.
|
||||||
def self.find_by_filename(filename)
|
def self.find_by_filename(filename)
|
||||||
basename = File.basename(filename)
|
basename = File.basename(filename)
|
||||||
extname = FileBlob.new(filename).extension
|
|
||||||
(@filename_index[basename] + find_by_extension(extname)).compact.uniq
|
# find the first extension with language definitions
|
||||||
|
extname = FileBlob.new(filename).extensions.detect do |e|
|
||||||
|
!@extension_index[e].empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
(@filename_index[basename] + @extension_index[extname]).compact.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: Look up Languages by file extension.
|
# Public: Look up Languages by file extension.
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
# search_term - Deprecated: Some languages maybe indexed under a
|
# search_term - Deprecated: Some languages maybe indexed under a
|
||||||
# different alias. Avoid defining new exceptions.
|
# different alias. Avoid defining new exceptions.
|
||||||
# color - CSS hex color to represent the language.
|
# color - CSS hex color to represent the language.
|
||||||
|
# tm_scope - The TextMate scope that represents this programming
|
||||||
|
# language. This should match one of the scopes listed in
|
||||||
|
# the grammars.yml file. Use "none" if there is no grammar
|
||||||
|
# for this language.
|
||||||
#
|
#
|
||||||
# Any additions or modifications (even trivial) should have corresponding
|
# Any additions or modifications (even trivial) should have corresponding
|
||||||
# test change in `test/test_blob.rb`.
|
# test change in `test/test_blob.rb`.
|
||||||
@@ -45,6 +49,7 @@ APL:
|
|||||||
extensions:
|
extensions:
|
||||||
- .apl
|
- .apl
|
||||||
- .dyalog
|
- .dyalog
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
ASP:
|
ASP:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -146,6 +151,7 @@ Arc:
|
|||||||
color: "#ca2afe"
|
color: "#ca2afe"
|
||||||
extensions:
|
extensions:
|
||||||
- .arc
|
- .arc
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Arduino:
|
Arduino:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -162,12 +168,14 @@ AsciiDoc:
|
|||||||
- .asciidoc
|
- .asciidoc
|
||||||
- .adoc
|
- .adoc
|
||||||
- .asc
|
- .asc
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
AspectJ:
|
AspectJ:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#1957b0"
|
color: "#1957b0"
|
||||||
extensions:
|
extensions:
|
||||||
- .aj
|
- .aj
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Assembly:
|
Assembly:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -185,6 +193,7 @@ Augeas:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .aug
|
- .aug
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
AutoHotkey:
|
AutoHotkey:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -194,6 +203,7 @@ AutoHotkey:
|
|||||||
extensions:
|
extensions:
|
||||||
- .ahk
|
- .ahk
|
||||||
- .ahkl
|
- .ahkl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
AutoIt:
|
AutoIt:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -286,6 +296,7 @@ Brightscript:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .brs
|
- .brs
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Bro:
|
Bro:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -359,6 +370,7 @@ CLIPS:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .clp
|
- .clp
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
CMake:
|
CMake:
|
||||||
extensions:
|
extensions:
|
||||||
@@ -421,6 +433,7 @@ Clean:
|
|||||||
extensions:
|
extensions:
|
||||||
- .icl
|
- .icl
|
||||||
- .dcl
|
- .dcl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Clojure:
|
Clojure:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -449,6 +462,7 @@ CoffeeScript:
|
|||||||
extensions:
|
extensions:
|
||||||
- .coffee
|
- .coffee
|
||||||
- ._coffee
|
- ._coffee
|
||||||
|
- .cjsx
|
||||||
- .cson
|
- .cson
|
||||||
- .iced
|
- .iced
|
||||||
filenames:
|
filenames:
|
||||||
@@ -537,6 +551,7 @@ Creole:
|
|||||||
wrap: true
|
wrap: true
|
||||||
extensions:
|
extensions:
|
||||||
- .creole
|
- .creole
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Crystal:
|
Crystal:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -606,6 +621,7 @@ Darcs Patch:
|
|||||||
extensions:
|
extensions:
|
||||||
- .darcspatch
|
- .darcspatch
|
||||||
- .dpatch
|
- .dpatch
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Dart:
|
Dart:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -633,6 +649,7 @@ Dogescript:
|
|||||||
color: "#cca760"
|
color: "#cca760"
|
||||||
extensions:
|
extensions:
|
||||||
- .djs
|
- .djs
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Dylan:
|
Dylan:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -648,6 +665,7 @@ E:
|
|||||||
color: "#ccce35"
|
color: "#ccce35"
|
||||||
extensions:
|
extensions:
|
||||||
- .E
|
- .E
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
ECL:
|
ECL:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -655,6 +673,7 @@ ECL:
|
|||||||
extensions:
|
extensions:
|
||||||
- .ecl
|
- .ecl
|
||||||
- .eclxml
|
- .eclxml
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Eagle:
|
Eagle:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -740,6 +759,7 @@ FLUX:
|
|||||||
extensions:
|
extensions:
|
||||||
- .fx
|
- .fx
|
||||||
- .flux
|
- .flux
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
FORTRAN:
|
FORTRAN:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -813,11 +833,13 @@ G-code:
|
|||||||
- .g
|
- .g
|
||||||
- .gco
|
- .gco
|
||||||
- .gcode
|
- .gcode
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
GAMS:
|
GAMS:
|
||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .gms
|
- .gms
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
GAP:
|
GAP:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -826,6 +848,7 @@ GAP:
|
|||||||
- .gap
|
- .gap
|
||||||
- .gd
|
- .gd
|
||||||
- .gi
|
- .gi
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
GAS:
|
GAS:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -839,6 +862,7 @@ GDScript:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .gd
|
- .gd
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
GLSL:
|
GLSL:
|
||||||
group: C
|
group: C
|
||||||
@@ -925,6 +949,7 @@ Golo:
|
|||||||
color: "#f6a51f"
|
color: "#f6a51f"
|
||||||
extensions:
|
extensions:
|
||||||
- .golo
|
- .golo
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Gosu:
|
Gosu:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -940,6 +965,7 @@ Grace:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .grace
|
- .grace
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Grammatical Framework:
|
Grammatical Framework:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -956,6 +982,7 @@ Graph Modeling Language:
|
|||||||
type: data
|
type: data
|
||||||
extensions:
|
extensions:
|
||||||
- .gml
|
- .gml
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Graphviz (DOT):
|
Graphviz (DOT):
|
||||||
type: data
|
type: data
|
||||||
@@ -1010,6 +1037,7 @@ HTML:
|
|||||||
- .html
|
- .html
|
||||||
- .htm
|
- .htm
|
||||||
- .st
|
- .st
|
||||||
|
- .xht
|
||||||
- .xhtml
|
- .xhtml
|
||||||
|
|
||||||
HTML+Django:
|
HTML+Django:
|
||||||
@@ -1045,6 +1073,7 @@ HTTP:
|
|||||||
type: data
|
type: data
|
||||||
extensions:
|
extensions:
|
||||||
- .http
|
- .http
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Hack:
|
Hack:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1052,6 +1081,7 @@ Hack:
|
|||||||
extensions:
|
extensions:
|
||||||
- .hh
|
- .hh
|
||||||
- .php
|
- .php
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Haml:
|
Haml:
|
||||||
group: HTML
|
group: HTML
|
||||||
@@ -1074,6 +1104,7 @@ Harbour:
|
|||||||
color: "#0e60e3"
|
color: "#0e60e3"
|
||||||
extensions:
|
extensions:
|
||||||
- .hb
|
- .hb
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Haskell:
|
Haskell:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1099,6 +1130,7 @@ Hy:
|
|||||||
- .hy
|
- .hy
|
||||||
aliases:
|
aliases:
|
||||||
- hylang
|
- hylang
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
IDL:
|
IDL:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1114,6 +1146,7 @@ IGOR Pro:
|
|||||||
aliases:
|
aliases:
|
||||||
- igor
|
- igor
|
||||||
- igorpro
|
- igorpro
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
INI:
|
INI:
|
||||||
type: data
|
type: data
|
||||||
@@ -1134,6 +1167,7 @@ IRC log:
|
|||||||
extensions:
|
extensions:
|
||||||
- .irclog
|
- .irclog
|
||||||
- .weechatlog
|
- .weechatlog
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Idris:
|
Idris:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1155,6 +1189,7 @@ Inform 7:
|
|||||||
Inno Setup:
|
Inno Setup:
|
||||||
extensions:
|
extensions:
|
||||||
- .iss
|
- .iss
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Io:
|
Io:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1175,11 +1210,13 @@ Isabelle:
|
|||||||
color: "#fdcd00"
|
color: "#fdcd00"
|
||||||
extensions:
|
extensions:
|
||||||
- .thy
|
- .thy
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
J:
|
J:
|
||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .ijs
|
- .ijs
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
JSON:
|
JSON:
|
||||||
type: data
|
type: data
|
||||||
@@ -1287,6 +1324,7 @@ KRL:
|
|||||||
color: "#f5c800"
|
color: "#f5c800"
|
||||||
extensions:
|
extensions:
|
||||||
- .krl
|
- .krl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Kit:
|
Kit:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -1320,6 +1358,7 @@ LOLCODE:
|
|||||||
extensions:
|
extensions:
|
||||||
- .lol
|
- .lol
|
||||||
color: "#cc9900"
|
color: "#cc9900"
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
LSL:
|
LSL:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1334,6 +1373,7 @@ LabVIEW:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .lvproj
|
- .lvproj
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Lasso:
|
Lasso:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1372,12 +1412,14 @@ Liquid:
|
|||||||
type: markup
|
type: markup
|
||||||
extensions:
|
extensions:
|
||||||
- .liquid
|
- .liquid
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Literate Agda:
|
Literate Agda:
|
||||||
type: programming
|
type: programming
|
||||||
group: Agda
|
group: Agda
|
||||||
extensions:
|
extensions:
|
||||||
- .lagda
|
- .lagda
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Literate CoffeeScript:
|
Literate CoffeeScript:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1554,6 +1596,7 @@ MediaWiki:
|
|||||||
wrap: true
|
wrap: true
|
||||||
extensions:
|
extensions:
|
||||||
- .mediawiki
|
- .mediawiki
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Mercury:
|
Mercury:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1568,6 +1611,7 @@ MiniD: # Legacy
|
|||||||
searchable: false
|
searchable: false
|
||||||
extensions:
|
extensions:
|
||||||
- .minid # Dummy extension
|
- .minid # Dummy extension
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Mirah:
|
Mirah:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1589,6 +1633,7 @@ Moocode:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .moo
|
- .moo
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
MoonScript:
|
MoonScript:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1600,6 +1645,7 @@ MoonScript:
|
|||||||
Myghty:
|
Myghty:
|
||||||
extensions:
|
extensions:
|
||||||
- .myt
|
- .myt
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
NSIS:
|
NSIS:
|
||||||
extensions:
|
extensions:
|
||||||
@@ -1645,6 +1691,7 @@ Nit:
|
|||||||
color: "#0d8921"
|
color: "#0d8921"
|
||||||
extensions:
|
extensions:
|
||||||
- .nit
|
- .nit
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Nix:
|
Nix:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1652,6 +1699,7 @@ Nix:
|
|||||||
- .nix
|
- .nix
|
||||||
aliases:
|
aliases:
|
||||||
- nixos
|
- nixos
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Nu:
|
Nu:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1672,6 +1720,7 @@ NumPy:
|
|||||||
- .numpy
|
- .numpy
|
||||||
- .numpyw
|
- .numpyw
|
||||||
- .numsc
|
- .numsc
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
OCaml:
|
OCaml:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1732,6 +1781,7 @@ Omgrofl:
|
|||||||
extensions:
|
extensions:
|
||||||
- .omgrofl
|
- .omgrofl
|
||||||
color: "#cabbff"
|
color: "#cabbff"
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Opa:
|
Opa:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1743,6 +1793,7 @@ Opal:
|
|||||||
color: "#f7ede0"
|
color: "#f7ede0"
|
||||||
extensions:
|
extensions:
|
||||||
- .opal
|
- .opal
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
OpenCL:
|
OpenCL:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1767,12 +1818,14 @@ OpenSCAD:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .scad
|
- .scad
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Org:
|
Org:
|
||||||
type: prose
|
type: prose
|
||||||
wrap: true
|
wrap: true
|
||||||
extensions:
|
extensions:
|
||||||
- .org
|
- .org
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Ox:
|
Ox:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1780,12 +1833,14 @@ Ox:
|
|||||||
- .ox
|
- .ox
|
||||||
- .oxh
|
- .oxh
|
||||||
- .oxo
|
- .oxo
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Oxygene:
|
Oxygene:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#5a63a3"
|
color: "#5a63a3"
|
||||||
extensions:
|
extensions:
|
||||||
- .oxygene
|
- .oxygene
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
PAWN:
|
PAWN:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1821,18 +1876,21 @@ Pan:
|
|||||||
color: '#cc0000'
|
color: '#cc0000'
|
||||||
extensions:
|
extensions:
|
||||||
- .pan
|
- .pan
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Papyrus:
|
Papyrus:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#6600cc"
|
color: "#6600cc"
|
||||||
extensions:
|
extensions:
|
||||||
- .psc
|
- .psc
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Parrot:
|
Parrot:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#f3ca0a"
|
color: "#f3ca0a"
|
||||||
extensions:
|
extensions:
|
||||||
- .parrot # Dummy extension
|
- .parrot # Dummy extension
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Parrot Assembly:
|
Parrot Assembly:
|
||||||
group: Parrot
|
group: Parrot
|
||||||
@@ -1843,6 +1901,7 @@ Parrot Assembly:
|
|||||||
- .pasm
|
- .pasm
|
||||||
interpreters:
|
interpreters:
|
||||||
- parrot
|
- parrot
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Parrot Internal Representation:
|
Parrot Internal Representation:
|
||||||
group: Parrot
|
group: Parrot
|
||||||
@@ -1898,12 +1957,14 @@ Perl6:
|
|||||||
- .pm6
|
- .pm6
|
||||||
interpreters:
|
interpreters:
|
||||||
- perl6
|
- perl6
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
PigLatin:
|
PigLatin:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#fcd7de"
|
color: "#fcd7de"
|
||||||
extensions:
|
extensions:
|
||||||
- .pig
|
- .pig
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Pike:
|
Pike:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -1918,12 +1979,14 @@ Pod:
|
|||||||
wrap: true
|
wrap: true
|
||||||
extensions:
|
extensions:
|
||||||
- .pod
|
- .pod
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
PogoScript:
|
PogoScript:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#d80074"
|
color: "#d80074"
|
||||||
extensions:
|
extensions:
|
||||||
- .pogo
|
- .pogo
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
PostScript:
|
PostScript:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -1966,6 +2029,7 @@ Propeller Spin:
|
|||||||
color: "#2b446d"
|
color: "#2b446d"
|
||||||
extensions:
|
extensions:
|
||||||
- .spin
|
- .spin
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Protocol Buffer:
|
Protocol Buffer:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -1989,6 +2053,7 @@ Pure Data:
|
|||||||
color: "#91de79"
|
color: "#91de79"
|
||||||
extensions:
|
extensions:
|
||||||
- .pd
|
- .pd
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
PureScript:
|
PureScript:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2087,7 +2152,7 @@ RHTML:
|
|||||||
group: HTML
|
group: HTML
|
||||||
extensions:
|
extensions:
|
||||||
- .rhtml
|
- .rhtml
|
||||||
tm_scope: text.html.ruby
|
tm_scope: text.html.erb
|
||||||
aliases:
|
aliases:
|
||||||
- html+ruby
|
- html+ruby
|
||||||
|
|
||||||
@@ -2098,6 +2163,7 @@ RMarkdown:
|
|||||||
extensions:
|
extensions:
|
||||||
- .rmd
|
- .rmd
|
||||||
- .Rmd
|
- .Rmd
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Racket:
|
Racket:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2117,6 +2183,7 @@ Ragel in Ruby Host:
|
|||||||
aliases:
|
aliases:
|
||||||
- ragel-rb
|
- ragel-rb
|
||||||
- ragel-ruby
|
- ragel-ruby
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Raw token data:
|
Raw token data:
|
||||||
search_term: raw
|
search_term: raw
|
||||||
@@ -2124,6 +2191,7 @@ Raw token data:
|
|||||||
- raw
|
- raw
|
||||||
extensions:
|
extensions:
|
||||||
- .raw
|
- .raw
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Rebol:
|
Rebol:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2143,10 +2211,12 @@ Red:
|
|||||||
- .reds
|
- .reds
|
||||||
aliases:
|
aliases:
|
||||||
- red/system
|
- red/system
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Redcode:
|
Redcode:
|
||||||
extensions:
|
extensions:
|
||||||
- .cw
|
- .cw
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
RobotFramework:
|
RobotFramework:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2221,6 +2291,7 @@ SAS:
|
|||||||
color: "#1E90FF"
|
color: "#1E90FF"
|
||||||
extensions:
|
extensions:
|
||||||
- .sas
|
- .sas
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
SCSS:
|
SCSS:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -2236,7 +2307,7 @@ SQF:
|
|||||||
extensions:
|
extensions:
|
||||||
- .sqf
|
- .sqf
|
||||||
- .hqf
|
- .hqf
|
||||||
tm_scope: source.c++
|
tm_scope: source.sqf
|
||||||
|
|
||||||
SQL:
|
SQL:
|
||||||
type: data
|
type: data
|
||||||
@@ -2316,6 +2387,7 @@ Self:
|
|||||||
color: "#0579aa"
|
color: "#0579aa"
|
||||||
extensions:
|
extensions:
|
||||||
- .self
|
- .self
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Shell:
|
Shell:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2354,6 +2426,7 @@ Shen:
|
|||||||
color: "#120F14"
|
color: "#120F14"
|
||||||
extensions:
|
extensions:
|
||||||
- .shen
|
- .shen
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Slash:
|
Slash:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2424,6 +2497,7 @@ Stylus:
|
|||||||
group: CSS
|
group: CSS
|
||||||
extensions:
|
extensions:
|
||||||
- .styl
|
- .styl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
SuperCollider:
|
SuperCollider:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2431,6 +2505,7 @@ SuperCollider:
|
|||||||
extensions:
|
extensions:
|
||||||
- .scd
|
- .scd
|
||||||
- .sc
|
- .sc
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Swift:
|
Swift:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2456,6 +2531,7 @@ TXL:
|
|||||||
type: programming
|
type: programming
|
||||||
extensions:
|
extensions:
|
||||||
- .txl
|
- .txl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Tcl:
|
Tcl:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2512,6 +2588,7 @@ Textile:
|
|||||||
wrap: true
|
wrap: true
|
||||||
extensions:
|
extensions:
|
||||||
- .textile
|
- .textile
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Thrift:
|
Thrift:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2525,6 +2602,7 @@ Turing:
|
|||||||
extensions:
|
extensions:
|
||||||
- .t
|
- .t
|
||||||
- .tu
|
- .tu
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
Twig:
|
Twig:
|
||||||
type: markup
|
type: markup
|
||||||
@@ -2785,6 +2863,7 @@ Zimpl:
|
|||||||
- .zimpl
|
- .zimpl
|
||||||
- .zmpl
|
- .zmpl
|
||||||
- .zpl
|
- .zpl
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
eC:
|
eC:
|
||||||
type: programming
|
type: programming
|
||||||
@@ -2792,6 +2871,7 @@ eC:
|
|||||||
extensions:
|
extensions:
|
||||||
- .ec
|
- .ec
|
||||||
- .eh
|
- .eh
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
edn:
|
edn:
|
||||||
type: data
|
type: data
|
||||||
@@ -2806,6 +2886,7 @@ fish:
|
|||||||
group: Shell
|
group: Shell
|
||||||
extensions:
|
extensions:
|
||||||
- .fish
|
- .fish
|
||||||
|
tm_scope: none
|
||||||
|
|
||||||
mupad:
|
mupad:
|
||||||
extensions:
|
extensions:
|
||||||
@@ -2846,3 +2927,4 @@ xBase:
|
|||||||
color: "#3a4040"
|
color: "#3a4040"
|
||||||
extensions:
|
extensions:
|
||||||
- .prg
|
- .prg
|
||||||
|
tm_scope: none
|
||||||
|
|||||||
@@ -110,6 +110,9 @@
|
|||||||
# MathJax
|
# MathJax
|
||||||
- (^|/)MathJax/
|
- (^|/)MathJax/
|
||||||
|
|
||||||
|
# Chart.js
|
||||||
|
- (^|/)Chart\.js$
|
||||||
|
|
||||||
# Codemirror
|
# Codemirror
|
||||||
- (^|/)[Cc]ode[Mm]irror/(lib|mode|theme|addon|keymap)
|
- (^|/)[Cc]ode[Mm]irror/(lib|mode|theme|addon|keymap)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Linguist
|
module Linguist
|
||||||
VERSION = "4.0.2"
|
VERSION = "4.0.3"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
###* @cjsx React.DOM ###
|
||||||
|
define 'myProject.ReactExampleComponent', [
|
||||||
|
'React'
|
||||||
|
'myProject.ExampleStore'
|
||||||
|
'myProject.ExampleActions'
|
||||||
|
'myProject.ReactExampleTable'
|
||||||
|
], (React, ExampleStore, ExampleActions, ReactExampleTable ) ->
|
||||||
|
|
||||||
|
ReactExampleComponent = React.createClass
|
||||||
|
mixins: [ListenMixin]
|
||||||
|
|
||||||
|
getInitialState: ->
|
||||||
|
rows: ExampleStore.getRows()
|
||||||
|
meta: ExampleStore.getMeta()
|
||||||
|
|
||||||
|
componentWillMount: ->
|
||||||
|
@listenTo ExampleStore
|
||||||
|
|
||||||
|
componentDidMount: ->
|
||||||
|
ExampleActions.getExampleData()
|
||||||
|
|
||||||
|
onStoreChange: ->
|
||||||
|
if this.isMounted()
|
||||||
|
@setState
|
||||||
|
rows: ExampleStore.getRows()
|
||||||
|
meta: ExampleStore.getMeta()
|
||||||
|
|
||||||
|
componentWillUnmount: ->
|
||||||
|
@stopListening ExampleStore
|
||||||
|
|
||||||
|
render: ->
|
||||||
|
<div className="page-wrap">
|
||||||
|
<header>
|
||||||
|
<strong> {@state.title} </strong>
|
||||||
|
<header>
|
||||||
|
<ReactExampleTable
|
||||||
|
rows={@state.rows},
|
||||||
|
meta={@state.meta}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>This is a XHTML sample file</title>
|
||||||
|
<style type="text/css"><![CDATA[
|
||||||
|
#example {
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
]]></style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="example">
|
||||||
|
Just a simple <strong>XHTML</strong> test page.
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
require "bundler/setup"
|
||||||
|
require "test/unit"
|
||||||
|
require "mocha/setup"
|
||||||
|
require "linguist"
|
||||||
+5
-6
@@ -1,9 +1,4 @@
|
|||||||
require 'linguist/file_blob'
|
require_relative "./helper"
|
||||||
require 'linguist/samples'
|
|
||||||
|
|
||||||
require 'test/unit'
|
|
||||||
require 'mocha/setup'
|
|
||||||
require 'mime/types'
|
|
||||||
|
|
||||||
class TestBlob < Test::Unit::TestCase
|
class TestBlob < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
@@ -297,6 +292,10 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert blob("deps/http_parser/http_parser.c").vendored?
|
assert blob("deps/http_parser/http_parser.c").vendored?
|
||||||
assert blob("deps/v8/src/v8.h").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
|
# Codemirror deps
|
||||||
assert blob("codemirror/mode/blah.js").vendored?
|
assert blob("codemirror/mode/blah.js").vendored?
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
require 'linguist/classifier'
|
require_relative "./helper"
|
||||||
require 'linguist/language'
|
|
||||||
require 'linguist/samples'
|
|
||||||
require 'linguist/tokenizer'
|
|
||||||
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestClassifier < Test::Unit::TestCase
|
class TestClassifier < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
require 'linguist/file_blob'
|
||||||
|
require 'test/unit'
|
||||||
|
|
||||||
|
class TestFileBlob < Test::Unit::TestCase
|
||||||
|
def test_extensions
|
||||||
|
assert_equal [".gitignore"], Linguist::FileBlob.new(".gitignore").extensions
|
||||||
|
assert_equal [".xml"], Linguist::FileBlob.new("build.xml").extensions
|
||||||
|
assert_equal [".html.erb", ".erb"], Linguist::FileBlob.new("dotted.dir/index.html.erb").extensions
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
require 'linguist/heuristics'
|
require_relative "./helper"
|
||||||
require 'linguist/language'
|
|
||||||
require 'linguist/samples'
|
|
||||||
require 'linguist/file_blob'
|
|
||||||
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestHeuristcs < Test::Unit::TestCase
|
class TestHeuristcs < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|||||||
+13
-2
@@ -1,5 +1,4 @@
|
|||||||
require 'linguist/language'
|
require_relative "./helper"
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestLanguage < Test::Unit::TestCase
|
class TestLanguage < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
@@ -222,6 +221,7 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
assert_equal [Language['Clojure']], Language.find_by_filename('riemann.config')
|
assert_equal [Language['Clojure']], Language.find_by_filename('riemann.config')
|
||||||
assert_equal [Language['HTML+Django']], Language.find_by_filename('index.jinja')
|
assert_equal [Language['HTML+Django']], Language.find_by_filename('index.jinja')
|
||||||
assert_equal [Language['Chapel']], Language.find_by_filename('examples/hello.chpl')
|
assert_equal [Language['Chapel']], Language.find_by_filename('examples/hello.chpl')
|
||||||
|
assert_equal [Language['Ant Build System']], Language.find_by_filename('build.ant.xml')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_find_by_shebang
|
def test_find_by_shebang
|
||||||
@@ -359,4 +359,15 @@ class TestLanguage < Test::Unit::TestCase
|
|||||||
def test_by_type
|
def test_by_type
|
||||||
assert !Language.by_type(:prose).nil?
|
assert !Language.by_type(:prose).nil?
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
+1
-3
@@ -1,6 +1,4 @@
|
|||||||
require 'linguist/md5'
|
require_relative "./helper"
|
||||||
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestMD5 < Test::Unit::TestCase
|
class TestMD5 < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
require 'test/unit'
|
require_relative "./helper"
|
||||||
require 'yaml'
|
|
||||||
|
|
||||||
class TestPedantic < Test::Unit::TestCase
|
class TestPedantic < Test::Unit::TestCase
|
||||||
filename = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
|
filename = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
require 'linguist/repository'
|
require_relative "./helper"
|
||||||
require 'linguist/lazy_blob'
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestRepository < Test::Unit::TestCase
|
class TestRepository < Test::Unit::TestCase
|
||||||
def rugged_repository
|
def rugged_repository
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
require 'linguist/samples'
|
require_relative "./helper"
|
||||||
require 'linguist/language'
|
require "tempfile"
|
||||||
require 'tempfile'
|
|
||||||
require 'yajl'
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestSamples < Test::Unit::TestCase
|
class TestSamples < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
require 'linguist/tokenizer'
|
require_relative "./helper"
|
||||||
|
|
||||||
require 'test/unit'
|
|
||||||
|
|
||||||
class TestTokenizer < Test::Unit::TestCase
|
class TestTokenizer < Test::Unit::TestCase
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user