mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-07 01:45:32 +00:00
Merge branch 'master' into 972
Conflicts: lib/linguist/vendor.yml
This commit is contained in:
@@ -4,3 +4,4 @@ require 'linguist/heuristics'
|
||||
require 'linguist/language'
|
||||
require 'linguist/repository'
|
||||
require 'linguist/samples'
|
||||
require 'linguist/version'
|
||||
|
||||
@@ -62,7 +62,8 @@ module Linguist
|
||||
generated_protocol_buffer? ||
|
||||
generated_jni_header? ||
|
||||
composer_lock? ||
|
||||
node_modules?
|
||||
node_modules? ||
|
||||
vcr_cassette?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an XCode project file?
|
||||
@@ -235,5 +236,15 @@ module Linguist
|
||||
def composer_lock?
|
||||
!!name.match(/composer.lock/)
|
||||
end
|
||||
|
||||
# Is the blob a VCR Cassette file?
|
||||
#
|
||||
# Returns true or false
|
||||
def vcr_cassette?
|
||||
return false unless extname == '.yml'
|
||||
return false unless lines.count > 2
|
||||
# VCR Cassettes have "recorded_with: VCR" in the second last line.
|
||||
return lines[-2].include?("recorded_with: VCR")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,6 +28,9 @@ module Linguist
|
||||
if languages.all? { |l| ["Common Lisp", "OpenCL"].include?(l) }
|
||||
disambiguate_cl(data, languages)
|
||||
end
|
||||
if languages.all? { |l| ["Rebol", "R"].include?(l) }
|
||||
disambiguate_r(data, languages)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -73,6 +76,13 @@ module Linguist
|
||||
matches
|
||||
end
|
||||
|
||||
def self.disambiguate_r(data, languages)
|
||||
matches = []
|
||||
matches << Language["Rebol"] if /\bRebol\b/i.match(data)
|
||||
matches << Language["R"] if data.include?("<-")
|
||||
matches
|
||||
end
|
||||
|
||||
def self.active?
|
||||
!!ACTIVE
|
||||
end
|
||||
|
||||
@@ -426,6 +426,11 @@ module Linguist
|
||||
#
|
||||
# Returns the extensions Array
|
||||
attr_reader :filenames
|
||||
|
||||
# Public: Return all possible extensions for language
|
||||
def all_extensions
|
||||
(extensions + [primary_extension]).uniq
|
||||
end
|
||||
|
||||
# Public: Get URL escaped name.
|
||||
#
|
||||
@@ -485,7 +490,7 @@ module Linguist
|
||||
#
|
||||
# Returns html String
|
||||
def colorize(text, options = {})
|
||||
lexer.highlight(text, options = {})
|
||||
lexer.highlight(text, options)
|
||||
end
|
||||
|
||||
# Public: Return name as String representation
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
# All languages have an associated lexer for syntax highlighting. It
|
||||
# defaults to name.downcase, which covers most cases.
|
||||
#
|
||||
# type - Either data, programming, markup, or nil
|
||||
# type - Either data, programming, markup, prose, or nil
|
||||
# lexer - An explicit lexer String (defaults to name)
|
||||
# aliases - An Array of additional aliases (implicitly
|
||||
# includes name.downcase)
|
||||
# ace_mode - A String name of Ace Mode (if available)
|
||||
# wrap - Boolean wrap to enable line wrapping (default: false)
|
||||
# extension - An Array of associated extensions
|
||||
# interpreter - An Array of associated interpreters
|
||||
# interpreters - An Array of associated interpreters
|
||||
# primary_extension - A String for the main extension associated with
|
||||
# the language. Must be unique. Used when a Language is picked
|
||||
# from a dropdown and we need to automatically choose an
|
||||
@@ -86,6 +86,12 @@ Agda:
|
||||
color: "#467C91"
|
||||
primary_extension: .agda
|
||||
|
||||
Alloy:
|
||||
type: programming # 'modeling' would be more appropiate
|
||||
lexer: Text only
|
||||
color: "#cc5c24"
|
||||
primary_extension: .als
|
||||
|
||||
ApacheConf:
|
||||
type: markup
|
||||
aliases:
|
||||
@@ -129,6 +135,12 @@ AsciiDoc:
|
||||
- .adoc
|
||||
- .asc
|
||||
|
||||
AspectJ:
|
||||
type: programming
|
||||
lexer: AspectJ
|
||||
color: "#1957b0"
|
||||
primary_extension: .aj
|
||||
|
||||
Assembly:
|
||||
type: programming
|
||||
lexer: NASM
|
||||
@@ -254,12 +266,14 @@ C++:
|
||||
extensions:
|
||||
- .C
|
||||
- .c++
|
||||
- .cc
|
||||
- .cxx
|
||||
- .H
|
||||
- .h++
|
||||
- .hh
|
||||
- .hpp
|
||||
- .hxx
|
||||
- .inl
|
||||
- .tcc
|
||||
- .tpp
|
||||
|
||||
@@ -299,7 +313,7 @@ COBOL:
|
||||
|
||||
CSS:
|
||||
ace_mode: css
|
||||
color: "#1f085e"
|
||||
color: "#563d7c"
|
||||
primary_extension: .css
|
||||
|
||||
Ceylon:
|
||||
@@ -318,8 +332,6 @@ Cirru:
|
||||
# ace_mode: cirru
|
||||
# lexer: Cirru
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .cr
|
||||
|
||||
Clean:
|
||||
type: programming
|
||||
@@ -341,6 +353,7 @@ Clojure:
|
||||
- .cljscm
|
||||
- .cljx
|
||||
- .hic
|
||||
- .cljs.hl
|
||||
filenames:
|
||||
- riemann.config
|
||||
|
||||
@@ -455,7 +468,7 @@ DM:
|
||||
- byond
|
||||
|
||||
DOT:
|
||||
type: programming
|
||||
type: data
|
||||
lexer: Text only
|
||||
primary_extension: .dot
|
||||
extensions:
|
||||
@@ -486,10 +499,25 @@ DCPU-16 ASM:
|
||||
Diff:
|
||||
primary_extension: .diff
|
||||
|
||||
Dogescript:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
color: "#cca760"
|
||||
primary_extension: .djs
|
||||
|
||||
Dylan:
|
||||
type: programming
|
||||
color: "#3ebc27"
|
||||
primary_extension: .dylan
|
||||
extensions:
|
||||
- .intr
|
||||
- .lid
|
||||
|
||||
E:
|
||||
type: programming
|
||||
color: "#ccce35"
|
||||
lexer: Text only
|
||||
primary_extension: .E
|
||||
|
||||
Ecere Projects:
|
||||
type: data
|
||||
@@ -505,6 +533,14 @@ ECL:
|
||||
extensions:
|
||||
- .eclxml
|
||||
|
||||
Eagle:
|
||||
type: markup
|
||||
color: "#3994bc"
|
||||
lexer: XML
|
||||
primary_extension: .sch
|
||||
extensions:
|
||||
- .brd
|
||||
|
||||
Eiffel:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
@@ -555,6 +591,14 @@ F#:
|
||||
- .fsi
|
||||
- .fsx
|
||||
|
||||
FLUX:
|
||||
type: programming
|
||||
color: "#33CCFF"
|
||||
primary_extension: .fx
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .flux
|
||||
|
||||
FORTRAN:
|
||||
type: programming
|
||||
lexer: Fortran
|
||||
@@ -607,6 +651,28 @@ Forth:
|
||||
extensions:
|
||||
- .4th
|
||||
|
||||
Frege:
|
||||
type: programming
|
||||
color: "#00cafe"
|
||||
lexer: Haskell
|
||||
primary_extension: .fr
|
||||
|
||||
Game Maker Language:
|
||||
type: programming
|
||||
color: "#8ad353"
|
||||
lexer: JavaScript
|
||||
primary_extension: .gml
|
||||
|
||||
GAP:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
primary_extension: .g
|
||||
extensions:
|
||||
- .g
|
||||
- .gap
|
||||
- .gd
|
||||
- .gi
|
||||
|
||||
GAS:
|
||||
type: programming
|
||||
group: Assembly
|
||||
@@ -621,10 +687,13 @@ GLSL:
|
||||
extensions:
|
||||
- .fp
|
||||
- .frag
|
||||
- .fshader
|
||||
- .geom
|
||||
- .glslv
|
||||
- .gshader
|
||||
- .shader
|
||||
- .vert
|
||||
- .vshader
|
||||
|
||||
Genshi:
|
||||
primary_extension: .kid
|
||||
@@ -654,9 +723,20 @@ Glyph:
|
||||
lexer: Tcl
|
||||
primary_extension: .glf
|
||||
|
||||
Gnuplot:
|
||||
type: programming
|
||||
color: "#f0a9f0"
|
||||
lexer: Gnuplot
|
||||
primary_extension: .gp
|
||||
extensions:
|
||||
- .gnu
|
||||
- .gnuplot
|
||||
- .plot
|
||||
- .plt
|
||||
|
||||
Go:
|
||||
type: programming
|
||||
color: "#a89b4d"
|
||||
color: "#375eab"
|
||||
primary_extension: .go
|
||||
|
||||
Gosu:
|
||||
@@ -664,6 +744,16 @@ Gosu:
|
||||
color: "#82937f"
|
||||
primary_extension: .gs
|
||||
|
||||
Grammatical Framework:
|
||||
type: programming
|
||||
lexer: Haskell
|
||||
aliases:
|
||||
- gf
|
||||
wrap: false
|
||||
primary_extension: .gf
|
||||
searchable: true
|
||||
color: "#ff0000"
|
||||
|
||||
Groff:
|
||||
primary_extension: .man
|
||||
extensions:
|
||||
@@ -698,6 +788,8 @@ HTML:
|
||||
primary_extension: .html
|
||||
extensions:
|
||||
- .htm
|
||||
- .html.hl
|
||||
- .st
|
||||
- .xhtml
|
||||
|
||||
HTML+Django:
|
||||
@@ -789,6 +881,10 @@ INI:
|
||||
- .properties
|
||||
primary_extension: .ini
|
||||
|
||||
Inno Setup:
|
||||
primary_extension: .iss
|
||||
lexer: Text only
|
||||
|
||||
Idris:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
@@ -796,6 +892,14 @@ Idris:
|
||||
extensions:
|
||||
- .lidr
|
||||
|
||||
Inform 7:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
wrap: true
|
||||
primary_extension: .ni
|
||||
extensions:
|
||||
- .i7x
|
||||
|
||||
Inno Setup:
|
||||
primary_extension: .iss
|
||||
lexer: Text only
|
||||
@@ -854,6 +958,12 @@ JSONLD:
|
||||
lexer: JavaScript
|
||||
primary_extension: .jsonld
|
||||
|
||||
JSONiq:
|
||||
type: programming
|
||||
ace_mode: jsoniq
|
||||
lexer: XQuery
|
||||
primary_extension: .jq
|
||||
|
||||
Jade:
|
||||
group: HTML
|
||||
type: markup
|
||||
@@ -876,7 +986,7 @@ Java Server Pages:
|
||||
JavaScript:
|
||||
type: programming
|
||||
ace_mode: javascript
|
||||
color: "#f15501"
|
||||
color: "#f1e05a"
|
||||
aliases:
|
||||
- js
|
||||
- node
|
||||
@@ -896,6 +1006,8 @@ JavaScript:
|
||||
- .ssjs
|
||||
filenames:
|
||||
- Jakefile
|
||||
interpreters:
|
||||
- node
|
||||
|
||||
Julia:
|
||||
type: programming
|
||||
@@ -908,6 +1020,12 @@ KRL:
|
||||
color: "#f5c800"
|
||||
primary_extension: .krl
|
||||
|
||||
Kit:
|
||||
type: markup
|
||||
lexer: HTML
|
||||
ace_mode: html
|
||||
primary_extension: .kit
|
||||
|
||||
Kotlin:
|
||||
type: programming
|
||||
primary_extension: .kt
|
||||
@@ -931,6 +1049,13 @@ Lasso:
|
||||
color: "#2584c3"
|
||||
primary_extension: .lasso
|
||||
|
||||
Latte:
|
||||
type: markup
|
||||
color: "#A8FF97"
|
||||
group: HTML
|
||||
lexer: Smarty
|
||||
primary_extension: .latte
|
||||
|
||||
Less:
|
||||
type: markup
|
||||
group: CSS
|
||||
@@ -943,6 +1068,11 @@ LilyPond:
|
||||
extensions:
|
||||
- .ily
|
||||
|
||||
Liquid:
|
||||
type: markup
|
||||
lexer: Text only
|
||||
primary_extension: .liquid
|
||||
|
||||
Literate Agda:
|
||||
type: programming
|
||||
group: Agda
|
||||
@@ -1011,6 +1141,12 @@ M:
|
||||
extensions:
|
||||
- .m
|
||||
|
||||
MTML:
|
||||
type: markup
|
||||
lexer: HTML
|
||||
color: "#0095d9"
|
||||
primary_extension: .mtml
|
||||
|
||||
Makefile:
|
||||
aliases:
|
||||
- make
|
||||
@@ -1042,10 +1178,24 @@ Markdown:
|
||||
- .mkdown
|
||||
- .ron
|
||||
|
||||
Mask:
|
||||
type: markup
|
||||
lexer: SCSS
|
||||
color: "#f97732"
|
||||
ace_mode: scss
|
||||
primary_extension: .mask
|
||||
|
||||
Mathematica:
|
||||
type: programming
|
||||
primary_extension: .mathematica
|
||||
lexer: Text only
|
||||
|
||||
Matlab:
|
||||
type: programming
|
||||
color: "#bb92ac"
|
||||
primary_extension: .matlab
|
||||
extensions:
|
||||
- .m
|
||||
|
||||
Max:
|
||||
type: programming
|
||||
@@ -1068,6 +1218,19 @@ MediaWiki:
|
||||
wrap: true
|
||||
primary_extension: .mediawiki
|
||||
|
||||
Mercury:
|
||||
type: programming
|
||||
# This is the background colour on the web page.
|
||||
color: "#abcdef"
|
||||
# The primary extension is .m, but lingist won't accept duplicates
|
||||
primary_extension: .mercury
|
||||
# Mercury's syntax is not prolog syntax, but they do share the lexer
|
||||
lexer: Prolog
|
||||
ace_mode: prolog
|
||||
extensions:
|
||||
- .m
|
||||
- .moo
|
||||
|
||||
MiniD: # Legacy
|
||||
searchable: false
|
||||
primary_extension: .minid # Dummy extension
|
||||
@@ -1089,6 +1252,7 @@ Monkey:
|
||||
primary_extension: .monkey
|
||||
|
||||
Moocode:
|
||||
type: programming
|
||||
lexer: MOOCode
|
||||
primary_extension: .moo
|
||||
|
||||
@@ -1166,8 +1330,14 @@ Objective-C:
|
||||
- obj-c
|
||||
- objc
|
||||
primary_extension: .m
|
||||
extensions:
|
||||
- .mm
|
||||
|
||||
Objective-C++:
|
||||
type: programming
|
||||
color: "#4886FC"
|
||||
aliases:
|
||||
- obj-c++
|
||||
- objc++
|
||||
primary_extension: .mm
|
||||
|
||||
Objective-J:
|
||||
type: programming
|
||||
@@ -1225,7 +1395,7 @@ PAWN:
|
||||
PHP:
|
||||
type: programming
|
||||
ace_mode: php
|
||||
color: "#6e03c1"
|
||||
color: "#4F5D95"
|
||||
primary_extension: .php
|
||||
extensions:
|
||||
- .aw
|
||||
@@ -1370,6 +1540,12 @@ Pure Data:
|
||||
lexer: Text only
|
||||
primary_extension: .pd
|
||||
|
||||
PureScript:
|
||||
type: programming
|
||||
color: "#bcdc53"
|
||||
lexer: Haskell
|
||||
primary_extension: .purs
|
||||
|
||||
Python:
|
||||
type: programming
|
||||
ace_mode: python
|
||||
@@ -1408,6 +1584,8 @@ R:
|
||||
aliases:
|
||||
- R
|
||||
primary_extension: .r
|
||||
aliases:
|
||||
- Rscript
|
||||
extensions:
|
||||
- .R
|
||||
- .rsx
|
||||
@@ -1473,11 +1651,21 @@ Rebol:
|
||||
type: programming
|
||||
lexer: REBOL
|
||||
color: "#358a5b"
|
||||
primary_extension: .rebol
|
||||
primary_extension: .reb
|
||||
extensions:
|
||||
- .r
|
||||
- .r2
|
||||
- .r3
|
||||
- .rebol
|
||||
|
||||
Red:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
color: "#ee0000"
|
||||
primary_extension: .red
|
||||
extensions:
|
||||
- .reds
|
||||
|
||||
Redcode:
|
||||
primary_extension: .cw
|
||||
|
||||
@@ -1523,11 +1711,14 @@ Ruby:
|
||||
filenames:
|
||||
- Appraisals
|
||||
- Berksfile
|
||||
- Buildfile
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- Guardfile
|
||||
- Podfile
|
||||
- Thorfile
|
||||
- Vagrantfile
|
||||
- buildfile
|
||||
|
||||
Rust:
|
||||
type: programming
|
||||
@@ -1545,6 +1736,11 @@ SQL:
|
||||
ace_mode: sql
|
||||
searchable: false
|
||||
primary_extension: .sql
|
||||
extensions:
|
||||
- .prc
|
||||
- .tab
|
||||
- .udf
|
||||
- .viw
|
||||
|
||||
Sage:
|
||||
type: programming
|
||||
@@ -1614,6 +1810,11 @@ Shell:
|
||||
filenames:
|
||||
- Dockerfile
|
||||
|
||||
ShellSession:
|
||||
type: programming
|
||||
lexer: Bash Session
|
||||
primary_extension: .sh-session
|
||||
|
||||
Shen:
|
||||
type: programming
|
||||
color: "#120F14"
|
||||
@@ -1633,6 +1834,13 @@ Smalltalk:
|
||||
Smarty:
|
||||
primary_extension: .tpl
|
||||
|
||||
SourcePawn:
|
||||
type: programming
|
||||
color: "#f69e1d"
|
||||
aliases:
|
||||
- sourcemod
|
||||
primary_extension: .sp
|
||||
|
||||
Squirrel:
|
||||
type: programming
|
||||
lexer: C++
|
||||
@@ -1647,6 +1855,19 @@ Standard ML:
|
||||
extensions:
|
||||
- .fun
|
||||
|
||||
Stata:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .ado
|
||||
- .do
|
||||
- .doh
|
||||
- .ihlp
|
||||
- .mata
|
||||
- .matah
|
||||
- .sthlp
|
||||
primary_extension: .do
|
||||
|
||||
Stylus:
|
||||
type: markup
|
||||
group: CSS
|
||||
@@ -1659,6 +1880,15 @@ SuperCollider:
|
||||
lexer: Text only
|
||||
primary_extension: .scd
|
||||
|
||||
SystemVerilog:
|
||||
type: programming
|
||||
color: "#343761"
|
||||
lexer: systemverilog
|
||||
primary_extension: .sv
|
||||
extensions:
|
||||
- .svh
|
||||
- .vh
|
||||
|
||||
TOML:
|
||||
type: data
|
||||
primary_extension: .toml
|
||||
@@ -1674,6 +1904,7 @@ Tcl:
|
||||
primary_extension: .tcl
|
||||
extensions:
|
||||
- .adp
|
||||
- .tm
|
||||
|
||||
Tcsh:
|
||||
type: programming
|
||||
@@ -1836,6 +2067,7 @@ XML:
|
||||
- .kml
|
||||
- .launch
|
||||
- .mxml
|
||||
- .osm
|
||||
- .plist
|
||||
- .pluginspec
|
||||
- .ps1xml
|
||||
@@ -1916,6 +2148,12 @@ YAML:
|
||||
- .rviz
|
||||
- .yaml
|
||||
|
||||
Zephir:
|
||||
type: programming
|
||||
lexer: PHP
|
||||
color: "#118f9e"
|
||||
primary_extension: .zep
|
||||
|
||||
eC:
|
||||
type: programming
|
||||
search_term: ec
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
||||
## Vendor Conventions ##
|
||||
|
||||
# Caches
|
||||
- cache/
|
||||
- (^|/)cache/
|
||||
|
||||
# Dependencies
|
||||
- ^[Dd]ependencies/
|
||||
@@ -101,6 +101,9 @@
|
||||
# D3.js
|
||||
- (^|\/)d3(\.v\d+)?([^.]*)(\.min)?\.js$
|
||||
|
||||
# React
|
||||
- (^|/)react(-[^.]*)?(\.min)?\.js$
|
||||
|
||||
## Python ##
|
||||
|
||||
# django
|
||||
@@ -120,10 +123,18 @@
|
||||
# Sparkle
|
||||
- (^|/)Sparkle/
|
||||
|
||||
## Groovy ##
|
||||
|
||||
# Gradle
|
||||
- (^|/)gradlew$
|
||||
- (^|/)gradlew\.bat$
|
||||
- (^|/)gradle/wrapper/
|
||||
|
||||
## .NET ##
|
||||
|
||||
# Visual Studio IntelliSense
|
||||
- -vsdoc\.js$
|
||||
- \.intellisense\.js$
|
||||
|
||||
# jQuery validation plugin (MS bundles this with asp.net mvc)
|
||||
- (^|/)jquery([^.]*)\.validate(\.unobtrusive)?(\.min)?\.js$
|
||||
@@ -178,3 +189,6 @@
|
||||
|
||||
# .DS_Store's
|
||||
- .[Dd][Ss]_[Ss]tore$
|
||||
|
||||
# Mercury --use-subdirs
|
||||
- Mercury/
|
||||
|
||||
3
lib/linguist/version.rb
Normal file
3
lib/linguist/version.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "2.10.15"
|
||||
end
|
||||
Reference in New Issue
Block a user