github-linguist 7.8.0 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +47 -0
  3. data/grammars/hint.haskell.json +47 -0
  4. data/grammars/hint.message.haskell.json +47 -0
  5. data/grammars/hint.type.haskell.json +47 -0
  6. data/grammars/markdown.plantuml.codeblock.json +26 -0
  7. data/grammars/source.4dm.json +104 -33
  8. data/grammars/source.abap.json +1 -1
  9. data/grammars/source.ahk.json +6 -2
  10. data/grammars/source.chapel.json +4 -4
  11. data/grammars/source.clarion.json +6 -6
  12. data/grammars/source.csound.json +1 -1
  13. data/grammars/source.dart.json +57 -31
  14. data/grammars/source.elixir.json +8 -0
  15. data/grammars/source.gcode.json +0 -4
  16. data/grammars/source.hack.json +4 -18
  17. data/grammars/source.haskell.json +47 -0
  18. data/grammars/source.hsig.json +47 -0
  19. data/grammars/source.julia.json +17 -17
  20. data/grammars/source.lean.json +19 -3
  21. data/grammars/source.lean.markdown.json +2598 -0
  22. data/grammars/source.matlab.json +215 -152
  23. data/grammars/source.mrc.json +416 -534
  24. data/grammars/source.nasl.json +155 -0
  25. data/grammars/source.nextflow.json +2 -2
  26. data/grammars/source.p4.json +21 -5
  27. data/grammars/source.prisma.json +7 -0
  28. data/grammars/source.qasm.json +66 -0
  29. data/grammars/source.ql.json +1408 -0
  30. data/grammars/source.tnsaudit.json +256 -0
  31. data/grammars/source.v.json +1 -1
  32. data/grammars/source.wsd.json +775 -0
  33. data/grammars/text.tex.latex.haskell.json +47 -0
  34. data/grammars/version +1 -1
  35. data/lib/linguist/VERSION +1 -1
  36. data/lib/linguist/file_blob.rb +1 -1
  37. data/lib/linguist/generated.rb +14 -3
  38. data/lib/linguist/heuristics.yml +7 -0
  39. data/lib/linguist/languages.json +1 -1
  40. data/lib/linguist/languages.yml +39 -0
  41. data/lib/linguist/linguist.bundle +0 -0
  42. data/lib/linguist/samples.json +1169 -38
  43. data/lib/linguist/shebang.rb +5 -3
  44. metadata +9 -3
  45. data/grammars/source.yaml-ext.json +0 -324
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Linguist
2
4
  class Shebang
3
5
  # Public: Use shebang to detect language of the blob.
@@ -23,10 +25,10 @@ module Linguist
23
25
  #
24
26
  # Returns a String or nil
25
27
  def self.interpreter(data)
26
- shebang = data.lines.first
27
-
28
28
  # First line must start with #!
29
- return unless shebang && shebang.start_with?("#!")
29
+ return unless data.start_with?("#!")
30
+
31
+ shebang = data[0, data.index($/) || data.length]
30
32
 
31
33
  s = StringScanner.new(shebang)
32
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-linguist
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.8.0
4
+ version: 7.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-29 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes
@@ -253,6 +253,7 @@ files:
253
253
  - grammars/injections.etc.json
254
254
  - grammars/markdown.haxe.codeblock.json
255
255
  - grammars/markdown.hxml.codeblock.json
256
+ - grammars/markdown.plantuml.codeblock.json
256
257
  - grammars/objdump.x86asm.json
257
258
  - grammars/source.4dm.json
258
259
  - grammars/source.SASLog.json
@@ -456,6 +457,7 @@ files:
456
457
  - grammars/source.julia.json
457
458
  - grammars/source.kotlin.json
458
459
  - grammars/source.lean.json
460
+ - grammars/source.lean.markdown.json
459
461
  - grammars/source.lex.json
460
462
  - grammars/source.lex.regexp.json
461
463
  - grammars/source.lid.json
@@ -496,6 +498,7 @@ files:
496
498
  - grammars/source.mrc.json
497
499
  - grammars/source.mupad.json
498
500
  - grammars/source.nanorc.json
501
+ - grammars/source.nasl.json
499
502
  - grammars/source.ncl.json
500
503
  - grammars/source.ne.json
501
504
  - grammars/source.nemerle.json
@@ -574,6 +577,8 @@ files:
574
577
  - grammars/source.python.salt.json
575
578
  - grammars/source.q.json
576
579
  - grammars/source.q_output.json
580
+ - grammars/source.qasm.json
581
+ - grammars/source.ql.json
577
582
  - grammars/source.qmake.json
578
583
  - grammars/source.qml.json
579
584
  - grammars/source.quake.json
@@ -641,6 +646,7 @@ files:
641
646
  - grammars/source.thrift.json
642
647
  - grammars/source.tl.json
643
648
  - grammars/source.tla.json
649
+ - grammars/source.tnsaudit.json
644
650
  - grammars/source.toc.json
645
651
  - grammars/source.toml.json
646
652
  - grammars/source.ts.json
@@ -668,6 +674,7 @@ files:
668
674
  - grammars/source.webidl.json
669
675
  - grammars/source.wgetrc.json
670
676
  - grammars/source.wollok.json
677
+ - grammars/source.wsd.json
671
678
  - grammars/source.x10.json
672
679
  - grammars/source.x86.json
673
680
  - grammars/source.x86asm.json
@@ -677,7 +684,6 @@ files:
677
684
  - grammars/source.xq.json
678
685
  - grammars/source.xtend.json
679
686
  - grammars/source.yacc.json
680
- - grammars/source.yaml-ext.json
681
687
  - grammars/source.yaml.json
682
688
  - grammars/source.yaml.salt.json
683
689
  - grammars/source.yang.json
@@ -1,324 +0,0 @@
1
- {
2
- "name": "YAML-ext",
3
- "scopeName": "source.yaml-ext",
4
- "patterns": [
5
- {
6
- "include": "#erb"
7
- },
8
- {
9
- "name": "string.unquoted.block.yaml-ext",
10
- "begin": "^(\\s*)(?!-\\s*)(\\S+\\s*(:))\\s*(\\||\u003e)",
11
- "end": "^(?!\\1\\s+)(?=\\s*(-|\\S+\\s*:|#))",
12
- "patterns": [
13
- {
14
- "include": "#erb"
15
- }
16
- ],
17
- "beginCaptures": {
18
- "2": {
19
- "name": "entity.name.tag.yaml-ext"
20
- },
21
- "3": {
22
- "name": "punctuation.separator.key-value.yaml-ext"
23
- }
24
- }
25
- },
26
- {
27
- "name": "string.unquoted.block.yaml-ext",
28
- "begin": "^(\\s*)(?:(-)|(?:(-(\\s*))?(\\S+\\s*(:))))\\s*(\\||\u003e)",
29
- "end": "^(?!\\1 \\4\\s+)(?=\\s*(-|\\S+\\s*:|#))",
30
- "patterns": [
31
- {
32
- "include": "#erb"
33
- }
34
- ],
35
- "beginCaptures": {
36
- "2": {
37
- "name": "punctuation.definition.entry.yaml-ext"
38
- },
39
- "3": {
40
- "name": "punctuation.definition.entry.yaml-ext"
41
- },
42
- "5": {
43
- "name": "entity.name.tag.yaml-ext"
44
- },
45
- "6": {
46
- "name": "punctuation.separator.key-value.yaml-ext"
47
- }
48
- }
49
- },
50
- {
51
- "name": "constant.numeric.yaml-ext",
52
- "match": "(?:(?:(-\\s*)?([^\\s#].*?(:)(?=\\s)))|(-))\\s*((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\s*($|(?=#)(?!#\\{))",
53
- "captures": {
54
- "1": {
55
- "name": "punctuation.definition.entry.yaml-ext"
56
- },
57
- "2": {
58
- "name": "entity.name.tag.yaml-ext"
59
- },
60
- "3": {
61
- "name": "punctuation.separator.key-value.yaml-ext"
62
- },
63
- "4": {
64
- "name": "punctuation.definition.entry.yaml-ext"
65
- }
66
- }
67
- },
68
- {
69
- "name": "string.unquoted.yaml-ext",
70
- "begin": "(?:(?:(-\\s*)?([^\\s#].*?(:)(?=\\s)))|(-))[ \t]*",
71
- "end": "$|(?=#)(?!#\\{)",
72
- "patterns": [
73
- {
74
- "name": "string.unquoted.yaml-ext",
75
- "match": "\\!\\s*"
76
- },
77
- {
78
- "include": "#double_quoted_string"
79
- },
80
- {
81
- "include": "#single_quoted_string"
82
- },
83
- {
84
- "name": "string.unquoted.yaml-ext",
85
- "match": "[^\"'#\\n]([^#\\n]|((?\u003c!\\s)#))*"
86
- }
87
- ],
88
- "beginCaptures": {
89
- "1": {
90
- "name": "punctuation.definition.entry.yaml-ext"
91
- },
92
- "2": {
93
- "name": "entity.name.tag.yaml-ext"
94
- },
95
- "3": {
96
- "name": "punctuation.separator.key-value.yaml-ext"
97
- },
98
- "4": {
99
- "name": "punctuation.definition.entry.yaml-ext"
100
- }
101
- }
102
- },
103
- {
104
- "name": "constant.other.date.yaml-ext",
105
- "match": "(?:(?:(-\\s*)?(\\w+\\s*(:)))|(-))\\s*([0-9]{4}-[0-9]{2}-[0-9]{2})\\s*($|(?=#)(?!#\\{))",
106
- "captures": {
107
- "1": {
108
- "name": "punctuation.definition.entry.yaml-ext"
109
- },
110
- "2": {
111
- "name": "entity.name.tag.yaml-ext"
112
- },
113
- "3": {
114
- "name": "punctuation.separator.key-value.yaml-ext"
115
- },
116
- "4": {
117
- "name": "punctuation.definition.entry.yaml-ext"
118
- }
119
- }
120
- },
121
- {
122
- "name": "meta.tag.yaml-ext",
123
- "match": "(\\w.*?)(:)\\s*((\\!\\!)omap)?",
124
- "captures": {
125
- "1": {
126
- "name": "entity.name.tag.yaml-ext"
127
- },
128
- "2": {
129
- "name": "punctuation.separator.key-value.yaml-ext"
130
- },
131
- "3": {
132
- "name": "keyword.other.omap.yaml-ext"
133
- },
134
- "4": {
135
- "name": "punctuation.definition.keyword.yaml-ext"
136
- }
137
- }
138
- },
139
- {
140
- "name": "variable.other.yaml-ext",
141
- "match": "(\\\u0026|\\*)\\w.*?$",
142
- "captures": {
143
- "1": {
144
- "name": "punctuation.definition.variable.yaml-ext"
145
- }
146
- }
147
- },
148
- {
149
- "include": "#double_quoted_string"
150
- },
151
- {
152
- "include": "#single_quoted_string"
153
- },
154
- {
155
- "name": "string.interpolated.yaml-ext",
156
- "begin": "`",
157
- "end": "`",
158
- "patterns": [
159
- {
160
- "include": "#escaped_char"
161
- },
162
- {
163
- "include": "#erb"
164
- }
165
- ],
166
- "beginCaptures": {
167
- "0": {
168
- "name": "punctuation.definition.string.begin.yaml-ext"
169
- }
170
- },
171
- "endCaptures": {
172
- "0": {
173
- "name": "punctuation.definition.string.end.yaml-ext"
174
- }
175
- }
176
- },
177
- {
178
- "name": "keyword.operator.merge-key.yaml-ext",
179
- "match": "(\\\u003c\\\u003c): ((\\*).*)$",
180
- "captures": {
181
- "1": {
182
- "name": "entity.name.tag.yaml-ext"
183
- },
184
- "2": {
185
- "name": "keyword.operator.merge-key.yaml-ext"
186
- },
187
- "3": {
188
- "name": "punctuation.definition.keyword.yaml-ext"
189
- }
190
- }
191
- },
192
- {
193
- "name": "invalid.deprecated.trailing-whitespace.yaml-ext",
194
- "match": "( |\t)+$",
195
- "disabled": true
196
- },
197
- {
198
- "begin": "(^[ \\t]+)?(?\u003c!\\$)(?\u003c=^|[ \\t])(?=#)(?!#\\{)",
199
- "end": "(?!\\G)",
200
- "patterns": [
201
- {
202
- "name": "comment.line.number-sign.yaml-ext",
203
- "begin": "#",
204
- "end": "\\n",
205
- "beginCaptures": {
206
- "0": {
207
- "name": "punctuation.definition.comment.yaml-ext"
208
- }
209
- }
210
- }
211
- ],
212
- "beginCaptures": {
213
- "1": {
214
- "name": "punctuation.whitespace.comment.leading.yaml-ext"
215
- }
216
- }
217
- },
218
- {
219
- "name": "keyword.operator.symbol",
220
- "match": "-"
221
- },
222
- {
223
- "name": "meta.leading-tabs.yaml-ext",
224
- "begin": "^(?=\\t)",
225
- "end": "(?=[^\\t])",
226
- "patterns": [
227
- {
228
- "match": "(\\t)(\\t)?",
229
- "captures": {
230
- "1": {
231
- "name": "meta.odd-tab"
232
- },
233
- "2": {
234
- "name": "meta.even-tab"
235
- }
236
- }
237
- }
238
- ]
239
- }
240
- ],
241
- "repository": {
242
- "double_quoted_string": {
243
- "name": "string.quoted.double.yaml-ext",
244
- "begin": "\"",
245
- "end": "\"",
246
- "patterns": [
247
- {
248
- "include": "#escaped_char"
249
- },
250
- {
251
- "include": "#erb"
252
- }
253
- ],
254
- "beginCaptures": {
255
- "0": {
256
- "name": "punctuation.definition.string.begin.yaml-ext"
257
- }
258
- },
259
- "endCaptures": {
260
- "0": {
261
- "name": "punctuation.definition.string.end.yaml-ext"
262
- }
263
- }
264
- },
265
- "erb": {
266
- "name": "meta.embedded.line.ruby",
267
- "contentName": "source.ruby.rails",
268
- "begin": "\u003c%+(?!\u003e)=?",
269
- "end": "(%)\u003e",
270
- "patterns": [
271
- {
272
- "name": "comment.line.number-sign.ruby",
273
- "match": "(#).*?(?=%\u003e)",
274
- "captures": {
275
- "1": {
276
- "name": "punctuation.definition.comment.ruby"
277
- }
278
- }
279
- },
280
- {}
281
- ],
282
- "beginCaptures": {
283
- "0": {
284
- "name": "punctuation.definition.embedded.begin.ruby"
285
- }
286
- },
287
- "endCaptures": {
288
- "0": {
289
- "name": "punctuation.definition.embedded.end.ruby"
290
- },
291
- "1": {
292
- "name": "source.ruby.rails"
293
- }
294
- }
295
- },
296
- "escaped_char": {
297
- "name": "constant.character.escape.yaml-ext",
298
- "match": "\\\\."
299
- },
300
- "single_quoted_string": {
301
- "name": "string.quoted.single.yaml-ext",
302
- "begin": "'",
303
- "end": "'",
304
- "patterns": [
305
- {
306
- "include": "#escaped_char"
307
- },
308
- {
309
- "include": "#erb"
310
- }
311
- ],
312
- "beginCaptures": {
313
- "0": {
314
- "name": "punctuation.definition.string.begin.yaml-ext"
315
- }
316
- },
317
- "endCaptures": {
318
- "0": {
319
- "name": "punctuation.definition.string.end.yaml-ext"
320
- }
321
- }
322
- }
323
- }
324
- }