mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fix conflicts from merging master into 'mod-extension'
This commit is contained in:
@@ -65,11 +65,13 @@ module Linguist
|
||||
generated_net_docfile? ||
|
||||
generated_postscript? ||
|
||||
compiled_cython_file? ||
|
||||
generated_protocol_buffer_go? ||
|
||||
generated_go? ||
|
||||
generated_protocol_buffer? ||
|
||||
generated_apache_thrift? ||
|
||||
generated_jni_header? ||
|
||||
vcr_cassette? ||
|
||||
generated_module?
|
||||
generated_module? ||
|
||||
generated_unity3d_meta?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -180,11 +182,11 @@ module Linguist
|
||||
def generated_net_designer_file?
|
||||
name.downcase =~ /\.designer\.cs$/
|
||||
end
|
||||
|
||||
|
||||
# Internal: Is this a codegen file for Specflow feature file?
|
||||
#
|
||||
# Visual Studio's SpecFlow extension generates *.feature.cs files
|
||||
# from *.feature files, they are not meant to be consumed by humans.
|
||||
# from *.feature files, they are not meant to be consumed by humans.
|
||||
# Let's hide them.
|
||||
#
|
||||
# Returns true or false
|
||||
@@ -232,11 +234,11 @@ module Linguist
|
||||
creator.include?("ImageMagick")
|
||||
end
|
||||
|
||||
def generated_protocol_buffer_go?
|
||||
def generated_go?
|
||||
return false unless extname == '.go'
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("Code generated by protoc-gen-go")
|
||||
return lines[0].include?("Code generated by")
|
||||
end
|
||||
|
||||
# Internal: Is the blob a C++, Java or Python source file generated by the
|
||||
@@ -250,6 +252,16 @@ module Linguist
|
||||
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
|
||||
end
|
||||
|
||||
# Internal: Is the blob generated by Apache Thrift compiler?
|
||||
#
|
||||
# Returns true or false
|
||||
def generated_apache_thrift?
|
||||
return false unless ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp'].include?(extname)
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler")
|
||||
end
|
||||
|
||||
# Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?
|
||||
#
|
||||
# Returns true of false.
|
||||
@@ -329,6 +341,18 @@ module Linguist
|
||||
return false unless lines.count > 1
|
||||
return lines[0].include?("PCBNEW-LibModule-V") ||
|
||||
lines[0].include?("GFORTRAN module version '")
|
||||
|
||||
# Internal: Is this a metadata file from Unity3D?
|
||||
#
|
||||
# Unity3D Meta files start with:
|
||||
# fileFormatVersion: X
|
||||
# guid: XXXXXXXXXXXXXXX
|
||||
#
|
||||
# Return true or false
|
||||
def generated_unity3d_meta?
|
||||
return false unless extname == '.meta'
|
||||
return false unless lines.count > 1
|
||||
return lines[0].include?("fileFormatVersion: ")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -293,11 +293,39 @@ module Linguist
|
||||
end
|
||||
|
||||
disambiguate "Rust", "RenderScript" do |data|
|
||||
if data.include?("^(use |fn |mod |pub |macro_rules|impl|#!?\[)")
|
||||
if /^(use |fn |mod |pub |macro_rules|impl|#!?\[)/.match(data)
|
||||
Language["Rust"]
|
||||
elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data)
|
||||
Language["RenderScript"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Common Lisp", "Lex", "Groff", "PicoLisp" do |data|
|
||||
if /\(def(un|macro)\s/.match(data)
|
||||
Language["Common Lisp"]
|
||||
elsif /^(%[%{}]xs|<.*>)/.match(data)
|
||||
Language["Lex"]
|
||||
elsif /^\.[a-z][a-z](\s|$)/i.match(data)
|
||||
Language["Groff"]
|
||||
elsif /^\((de|class|rel|code|data|must)\s/.match(data)
|
||||
Language["PicoLisp"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Groff", "Nemerle" do |data|
|
||||
if /^[.']/.match(data)
|
||||
Language["Groff"]
|
||||
elsif /^(module|namespace|using)\s/.match(data)
|
||||
Language["Nemerle"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "GAS", "Groff" do |data|
|
||||
if /^[.'][a-z][a-z](\s|$)/i.match(data)
|
||||
Language["Groff"]
|
||||
elsif /((^|\s)move?[. ])|\.(include|globa?l)\s/.match(data)
|
||||
Language["GAS"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -161,6 +161,7 @@ ApacheConf:
|
||||
- apache
|
||||
extensions:
|
||||
- .apacheconf
|
||||
- .vhost
|
||||
tm_scope: source.apache-config
|
||||
ace_mode: apache_conf
|
||||
|
||||
@@ -296,9 +297,10 @@ Befunge:
|
||||
|
||||
Bison:
|
||||
type: programming
|
||||
group: Yacc
|
||||
tm_scope: source.bison
|
||||
extensions:
|
||||
- .y
|
||||
- .bison
|
||||
ace_mode: text
|
||||
|
||||
BitBake:
|
||||
@@ -601,6 +603,7 @@ Common Lisp:
|
||||
- .lisp
|
||||
- .asd
|
||||
- .cl
|
||||
- .l
|
||||
- .lsp
|
||||
- .ny
|
||||
- .podsl
|
||||
@@ -1039,6 +1042,7 @@ GAS:
|
||||
group: Assembly
|
||||
extensions:
|
||||
- .s
|
||||
- .ms
|
||||
tm_scope: source.asm.x86
|
||||
ace_mode: assembly_x86
|
||||
|
||||
@@ -1207,12 +1211,26 @@ Groff:
|
||||
extensions:
|
||||
- .man
|
||||
- '.1'
|
||||
- .1in
|
||||
- .1m
|
||||
- .1x
|
||||
- '.2'
|
||||
- '.3'
|
||||
- .3in
|
||||
- .3m
|
||||
- .3qt
|
||||
- .3x
|
||||
- '.4'
|
||||
- '.5'
|
||||
- '.6'
|
||||
- '.7'
|
||||
- '.8'
|
||||
- '.9'
|
||||
- .l
|
||||
- .ms
|
||||
- .n
|
||||
- .rno
|
||||
- .roff
|
||||
tm_scope: text.groff
|
||||
aliases:
|
||||
- nroff
|
||||
@@ -1342,7 +1360,7 @@ Haskell:
|
||||
Haxe:
|
||||
type: programming
|
||||
ace_mode: haxe
|
||||
color: "#f7941e"
|
||||
color: "#df7900"
|
||||
extensions:
|
||||
- .hx
|
||||
- .hxsl
|
||||
@@ -1364,7 +1382,7 @@ HyPhy:
|
||||
extensions:
|
||||
- .bf
|
||||
tm_scope: none
|
||||
|
||||
|
||||
IDL:
|
||||
type: programming
|
||||
color: "#a3522f"
|
||||
@@ -1458,6 +1476,14 @@ Isabelle:
|
||||
tm_scope: source.isabelle.theory
|
||||
ace_mode: text
|
||||
|
||||
Isabelle ROOT:
|
||||
type: programming
|
||||
group: Isabelle
|
||||
filenames:
|
||||
- ROOT
|
||||
tm_scope: source.isabelle.root
|
||||
ace_mode: text
|
||||
|
||||
J:
|
||||
type: programming
|
||||
color: "#9EEDFF"
|
||||
@@ -1469,6 +1495,7 @@ J:
|
||||
JFlex:
|
||||
type: programming
|
||||
color: "#DBCA00"
|
||||
group: Lex
|
||||
extensions:
|
||||
- .flex
|
||||
- .jflex
|
||||
@@ -1504,11 +1531,12 @@ JSONLD:
|
||||
tm_scope: source.js
|
||||
|
||||
JSONiq:
|
||||
color: "#40d47e"
|
||||
type: programming
|
||||
ace_mode: jsoniq
|
||||
extensions:
|
||||
- .jq
|
||||
tm_scope: source.xquery
|
||||
tm_scope: source.jq
|
||||
|
||||
Jade:
|
||||
group: HTML
|
||||
@@ -1619,7 +1647,7 @@ Kit:
|
||||
|
||||
Kotlin:
|
||||
type: programming
|
||||
color: "#EA4DFA"
|
||||
color: "#F18E33"
|
||||
extensions:
|
||||
- .kt
|
||||
- .ktm
|
||||
@@ -1686,7 +1714,7 @@ Latte:
|
||||
group: HTML
|
||||
extensions:
|
||||
- .latte
|
||||
tm_scope: source.smarty
|
||||
tm_scope: text.html.smarty
|
||||
ace_mode: smarty
|
||||
|
||||
Lean:
|
||||
@@ -1704,6 +1732,17 @@ Less:
|
||||
tm_scope: source.css.less
|
||||
ace_mode: less
|
||||
|
||||
Lex:
|
||||
type: programming
|
||||
color: "#DBCA00"
|
||||
aliases:
|
||||
- flex
|
||||
extensions:
|
||||
- .l
|
||||
- .lex
|
||||
tm_scope: none
|
||||
ace_mode: text
|
||||
|
||||
LilyPond:
|
||||
type: programming
|
||||
extensions:
|
||||
@@ -1873,6 +1912,7 @@ Makefile:
|
||||
- .mk
|
||||
filenames:
|
||||
- GNUmakefile
|
||||
- Kbuild
|
||||
- Makefile
|
||||
- makefile
|
||||
interpreters:
|
||||
@@ -2111,6 +2151,9 @@ Nginx:
|
||||
type: markup
|
||||
extensions:
|
||||
- .nginxconf
|
||||
- .vhost
|
||||
filenames:
|
||||
- nginx.conf
|
||||
tm_scope: source.nginx
|
||||
aliases:
|
||||
- nginx configuration file
|
||||
@@ -2435,6 +2478,7 @@ Perl:
|
||||
color: "#0298c3"
|
||||
extensions:
|
||||
- .pl
|
||||
- .al
|
||||
- .cgi
|
||||
- .fcgi
|
||||
- .perl
|
||||
@@ -2469,6 +2513,16 @@ Perl6:
|
||||
tm_scope: source.perl.6
|
||||
ace_mode: perl
|
||||
|
||||
PicoLisp:
|
||||
type: programming
|
||||
extensions:
|
||||
- .l
|
||||
interpreters:
|
||||
- picolisp
|
||||
- pil
|
||||
tm_scope: source.lisp
|
||||
ace_mode: lisp
|
||||
|
||||
PigLatin:
|
||||
type: programming
|
||||
color: "#fcd7de"
|
||||
@@ -2646,6 +2700,7 @@ QML:
|
||||
color: "#44a51c"
|
||||
extensions:
|
||||
- .qml
|
||||
- .qbs
|
||||
tm_scope: source.qml
|
||||
ace_mode: text
|
||||
|
||||
@@ -2736,7 +2791,7 @@ Racket:
|
||||
|
||||
Ragel in Ruby Host:
|
||||
type: programming
|
||||
color: "#e17600"
|
||||
color: "#9d5200"
|
||||
extensions:
|
||||
- .rl
|
||||
aliases:
|
||||
@@ -2843,11 +2898,15 @@ Ruby:
|
||||
- ruby
|
||||
- macruby
|
||||
- rake
|
||||
- jruby
|
||||
- rbx
|
||||
filenames:
|
||||
- .pryrc
|
||||
- Appraisals
|
||||
- Berksfile
|
||||
- Buildfile
|
||||
- Deliverfile
|
||||
- Fastfile
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- Guardfile
|
||||
@@ -2855,6 +2914,7 @@ Ruby:
|
||||
- Mavenfile
|
||||
- Podfile
|
||||
- Puppetfile
|
||||
- Snapfile
|
||||
- Thorfile
|
||||
- Vagrantfile
|
||||
- buildfile
|
||||
@@ -2882,6 +2942,25 @@ SCSS:
|
||||
extensions:
|
||||
- .scss
|
||||
|
||||
SMT:
|
||||
type: programming
|
||||
extensions:
|
||||
- .smt2
|
||||
- .smt
|
||||
interpreters:
|
||||
- boolector
|
||||
- cvc4
|
||||
- mathsat5
|
||||
- opensmt
|
||||
- smtinterpol
|
||||
- smt-rat
|
||||
- stp
|
||||
- verit
|
||||
- yices2
|
||||
- z3
|
||||
tm_scope: source.smt
|
||||
ace_mode: text
|
||||
|
||||
SPARQL:
|
||||
type: data
|
||||
tm_scope: source.sparql
|
||||
@@ -3074,6 +3153,13 @@ Slim:
|
||||
- .slim
|
||||
ace_mode: text
|
||||
|
||||
Smali:
|
||||
type: programming
|
||||
extensions:
|
||||
- .smali
|
||||
ace_mode: text
|
||||
tm_scope: source.smali
|
||||
|
||||
Smalltalk:
|
||||
type: programming
|
||||
color: "#596706"
|
||||
@@ -3089,6 +3175,7 @@ Smarty:
|
||||
extensions:
|
||||
- .tpl
|
||||
ace_mode: smarty
|
||||
tm_scope: text.html.smarty
|
||||
|
||||
SourcePawn:
|
||||
type: programming
|
||||
@@ -3277,7 +3364,7 @@ Turtle:
|
||||
|
||||
Twig:
|
||||
type: markup
|
||||
group: PHP
|
||||
group: HTML
|
||||
extensions:
|
||||
- .twig
|
||||
tm_scope: text.html.twig
|
||||
@@ -3302,6 +3389,19 @@ Unified Parallel C:
|
||||
- .upc
|
||||
tm_scope: source.c
|
||||
|
||||
Unity3D Asset:
|
||||
type: data
|
||||
ace_mode: yaml
|
||||
color: "#ab69a1"
|
||||
extensions:
|
||||
- .anim
|
||||
- .asset
|
||||
- .mat
|
||||
- .meta
|
||||
- .prefab
|
||||
- .unity
|
||||
tm_scope: source.yaml
|
||||
|
||||
UnrealScript:
|
||||
type: programming
|
||||
color: "#a54c4d"
|
||||
@@ -3439,11 +3539,14 @@ XML:
|
||||
- .fsproj
|
||||
- .fxml
|
||||
- .glade
|
||||
- .gml
|
||||
- .grxml
|
||||
- .iml
|
||||
- .ivy
|
||||
- .jelly
|
||||
- .kml
|
||||
- .launch
|
||||
- .mdpolicy
|
||||
- .mm
|
||||
- .mod
|
||||
- .mxml
|
||||
@@ -3519,6 +3622,7 @@ XQuery:
|
||||
- .xqm
|
||||
- .xqy
|
||||
ace_mode: xquery
|
||||
tm_scope: source.xq
|
||||
|
||||
XS:
|
||||
type: programming
|
||||
@@ -3567,6 +3671,15 @@ YAML:
|
||||
- .yaml
|
||||
ace_mode: yaml
|
||||
|
||||
Yacc:
|
||||
type: programming
|
||||
extensions:
|
||||
- .y
|
||||
- .yacc
|
||||
- .yy
|
||||
tm_scope: source.bison
|
||||
ace_mode: text
|
||||
|
||||
Zephir:
|
||||
type: programming
|
||||
color: "#118f9e"
|
||||
|
||||
@@ -2,7 +2,7 @@ module Linguist
|
||||
module Strategy
|
||||
class Modeline
|
||||
EmacsModeline = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
|
||||
VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i
|
||||
VimModeline = /vim:\s*set\s*(?:ft|filetype)=(\w+):/i
|
||||
|
||||
# Public: Detects language based on Vim and Emacs modelines
|
||||
#
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
- 3rd[-_]?party/
|
||||
- vendors?/
|
||||
- extern(al)?/
|
||||
- (^|/)[Vv]+endor/
|
||||
|
||||
# Debian packaging
|
||||
- ^debian/
|
||||
@@ -163,12 +164,22 @@
|
||||
|
||||
## Obj-C ##
|
||||
|
||||
# Carthage
|
||||
- ^Carthage/
|
||||
|
||||
# Cocoapods
|
||||
- ^Pods/
|
||||
|
||||
# Sparkle
|
||||
- (^|/)Sparkle/
|
||||
|
||||
# Crashlytics
|
||||
- Crashlytics.framework/
|
||||
|
||||
# Fabric
|
||||
- Fabric.framework/
|
||||
|
||||
|
||||
## Groovy ##
|
||||
|
||||
# Gradle
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "4.5.4"
|
||||
VERSION = "4.5.7"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user