linguist-js 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,16 +12,25 @@ function pcre(regex) {
12
12
  replace(match, '');
13
13
  [...flags].forEach(flag => finalFlags.add(flag));
14
14
  }
15
- // Remove invalid syntax
15
+ // Remove PCRE-only syntax
16
16
  replace(/([*+]){2}/g, '$1');
17
17
  replace(/\(\?>/g, '(?:');
18
18
  // Remove start/end-of-file markers
19
19
  if (/\\[AZ]/.test(finalRegex)) {
20
- replace(/\\A/g, '^').replace(/\\Z/g, '$');
20
+ replace(/\\A/g, '^');
21
+ replace(/\\Z/g, '$');
21
22
  finalFlags.delete('m');
22
23
  }
23
- else
24
+ else {
24
25
  finalFlags.add('m');
26
+ }
27
+ // Reformat free-spacing mode
28
+ if (finalFlags.has('x')) {
29
+ finalFlags.delete('x');
30
+ replace(/#.+/g, '');
31
+ replace(/^\s+|\s+$|\n/gm, '');
32
+ replace(/\s+/g, ' ');
33
+ }
25
34
  // Return final regex
26
35
  return RegExp(finalRegex, [...finalFlags].join(''));
27
36
  }
package/dist/index.js CHANGED
@@ -123,7 +123,7 @@ async function analyse(input, opts = {}) {
123
123
  forcedLang = overrideLang[0];
124
124
  }
125
125
  }
126
- const fullPath = relPath(folder) + '/' + path;
126
+ const fullPath = path_1.default.join(relPath(folder), path);
127
127
  overrides[fullPath] = forcedLang;
128
128
  }
129
129
  }
package/dist/schema.d.ts CHANGED
@@ -33,5 +33,5 @@ export interface HeuristicsSchema {
33
33
  }>;
34
34
  named_patterns: Record<string, string | string[]>;
35
35
  }
36
- export declare type VendorSchema = string[];
36
+ export type VendorSchema = string[];
37
37
  export {};
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare type LanguageResult = string | null;
2
- export declare type Language = string;
3
- export declare type Category = 'data' | 'markup' | 'programming' | 'prose';
4
- export declare type FilePath = string;
5
- export declare type Bytes = Integer;
6
- export declare type Integer = number;
1
+ export type LanguageResult = string | null;
2
+ export type Language = string;
3
+ export type Category = 'data' | 'markup' | 'programming' | 'prose';
4
+ export type FilePath = string;
5
+ export type Bytes = Integer;
6
+ export type Integer = number;
7
7
  export interface Options {
8
8
  fileContent?: string | string[];
9
9
  ignoredFiles?: string[];
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  - ^[Dd]ocs?/
2
4
  - (^|/)[Dd]ocumentation/
3
5
  - (^|/)[Gg]roovydoc/
@@ -5,7 +7,9 @@
5
7
  - ^[Mm]an/
6
8
  - ^[Ee]xamples/
7
9
  - ^[Dd]emos?/
8
- - (^|/)inst/doc/- (^|/)CITATION(\.cff|(S)?(\.(bib|md))?)$
10
+ - (^|/)inst/doc/
11
+
12
+ - (^|/)CITATION(\.cff|(S)?(\.(bib|md))?)$
9
13
  - (^|/)CHANGE(S|LOG)?(\.|$)
10
14
  - (^|/)CONTRIBUTING(\.|$)
11
15
  - (^|/)COPYING(\.|$)
@@ -14,4 +18,4 @@
14
18
  - (^|/)[Ll]icen[cs]e(\.|$)
15
19
  - (^|/)README(\.|$)
16
20
  - (^|/)[Rr]eadme(\.|$)
17
- - ^[Ss]amples?/
21
+ - ^[Ss]amples?/
package/ext/generated.rb CHANGED
@@ -7,7 +7,9 @@ module Linguist
7
7
  @name = name
8
8
  @extname = File.extname(name)
9
9
  @_data = data
10
- end attr_reader :name, :extname
10
+ end
11
+
12
+ attr_reader :name, :extname
11
13
  def data
12
14
  @data ||= @_data.respond_to?(:call) ? @_data.call() : @_data
13
15
  end
@@ -28,6 +30,7 @@ module Linguist
28
30
  go_vendor? ||
29
31
  go_lock? ||
30
32
  poetry_lock? ||
33
+ pdm_lock? ||
31
34
  esy_lock? ||
32
35
  npm_shrinkwrap_or_package_lock? ||
33
36
  terraform_lock? ||
@@ -67,7 +70,8 @@ module Linguist
67
70
  generated_visualstudio6? ||
68
71
  generated_haxe? ||
69
72
  generated_jooq? ||
70
- generated_pascal_tlb?
73
+ generated_pascal_tlb? ||
74
+ generated_sorbet_rbi?
71
75
  end
72
76
  def xcode_file?
73
77
  ['.nib', '.xcworkspacedata', '.xcuserstate'].include?(extname)
@@ -96,7 +100,9 @@ module Linguist
96
100
  lines.last(2).any? { |l| l.match(/^\/[*\/][\#@] source(?:Mapping)?URL|sourceURL=/) }
97
101
  end
98
102
  def source_map?
99
- return false unless extname.downcase == '.map' name =~ /(\.css|\.js)\.map$/i ||
103
+ return false unless extname.downcase == '.map'
104
+
105
+ name =~ /(\.css|\.js)\.map$/i ||
100
106
  lines[0] =~ /^{"version":\d+,/ ||
101
107
  lines[0] =~ /^\/\*\* Begin line maps\. \*\*\/{/
102
108
  end
@@ -104,9 +110,15 @@ module Linguist
104
110
  return false unless extname == '.js'
105
111
  if lines[0] =~ /^\/\/ Generated by /
106
112
  return true
107
- end if lines[0] == '(function() {' &&
113
+ end
114
+
115
+ if lines[0] == '(function() {' &&
108
116
  lines[-2] == '}).call(this);' &&
109
- lines[-1] == '' score = 0 lines.each do |line|
117
+ lines[-1] == ''
118
+
119
+ score = 0
120
+
121
+ lines.each do |line|
110
122
  if line =~ /var /
111
123
  score += 1 * line.gsub(/(_fn|_i|_len|_ref|_results)/).count
112
124
  score += 3 * line.gsub(/(__bind|__extends|__hasProp|__indexOf|__slice)/).count
@@ -134,7 +146,9 @@ module Linguist
134
146
  return false unless extname == '.js'
135
147
  if lines[0..4].join('') =~ /^(?:[^\/]|\/[^\*])*\/\*(?:[^\*]|\*[^\/])*Generated by PEG.js/
136
148
  return true
137
- end false
149
+ end
150
+
151
+ false
138
152
  end
139
153
  def generated_postscript?
140
154
  return false unless ['.ps', '.eps', '.pfa'].include? extname
@@ -144,29 +158,45 @@ module Linguist
144
158
  return true if creator =~ /[0-9]|draw|mpage|ImageMagick|inkscape|MATLAB/ ||
145
159
  creator =~ /PCBNEW|pnmtops|\(Unknown\)|Serif Affinity|Filterimage -tops/
146
160
  !!creator.include?("EAGLE") and lines[0..4].find {|line| line =~ /^%%Title: EAGLE Drawing /}
147
- end def generated_go?
161
+ end
162
+
163
+ def generated_go?
148
164
  return false unless extname == '.go'
149
- return false unless lines.count > 1 return lines.first(40).any? { |l| l.include? "Code generated by" }
165
+ return false unless lines.count > 1
166
+
167
+ return lines.first(40).any? { |l| l =~ %r{^// Code generated .*} }
150
168
  end
151
169
  def generated_protocol_buffer_from_go?
152
170
  return false unless extname == '.proto'
153
- return false unless lines.count > 1 return lines.first(20).any? { |l| l.include? "This file was autogenerated by go-to-protobuf" }
154
- end PROTOBUF_EXTENSIONS = ['.py', '.java', '.h', '.cc', '.cpp', '.m', '.rb', '.php']
171
+ return false unless lines.count > 1
172
+
173
+ return lines.first(20).any? { |l| l.include? "This file was autogenerated by go-to-protobuf" }
174
+ end
175
+
176
+ PROTOBUF_EXTENSIONS = ['.py', '.java', '.h', '.cc', '.cpp', '.m', '.rb', '.php']
155
177
  def generated_protocol_buffer?
156
178
  return false unless PROTOBUF_EXTENSIONS.include?(extname)
157
- return false unless lines.count > 1 return lines.first(3).any? { |l| l.include?("Generated by the protocol buffer compiler. DO NOT EDIT!") }
179
+ return false unless lines.count > 1
180
+
181
+ return lines.first(3).any? { |l| l.include?("Generated by the protocol buffer compiler. DO NOT EDIT!") }
158
182
  end
159
183
  def generated_javascript_protocol_buffer?
160
184
  return false unless extname == ".js"
161
- return false unless lines.count > 6 return lines[5].include?("GENERATED CODE -- DO NOT EDIT!")
162
- end APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php']
185
+ return false unless lines.count > 6
186
+
187
+ return lines[5].include?("GENERATED CODE -- DO NOT EDIT!")
188
+ end
189
+
190
+ APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php']
163
191
  def generated_apache_thrift?
164
192
  return false unless APACHE_THRIFT_EXTENSIONS.include?(extname)
165
193
  return lines.first(6).any? { |l| l.include?("Autogenerated by Thrift Compiler") }
166
194
  end
167
195
  def generated_jni_header?
168
196
  return false unless extname == '.h'
169
- return false unless lines.count > 2 return lines[0].include?("/* DO NOT EDIT THIS FILE - it is machine generated */") &&
197
+ return false unless lines.count > 2
198
+
199
+ return lines[0].include?("/* DO NOT EDIT THIS FILE - it is machine generated */") &&
170
200
  lines[1].include?("#include <jni.h>")
171
201
  end
172
202
  def node_modules?
@@ -181,6 +211,9 @@ module Linguist
181
211
  def poetry_lock?
182
212
  !!name.match(/poetry\.lock/)
183
213
  end
214
+ def pdm_lock?
215
+ !!name.match(/pdm\.lock/)
216
+ end
184
217
  def esy_lock?
185
218
  !!name.match(/(^|\/)(\w+\.)?esy.lock$/)
186
219
  end
@@ -251,7 +284,9 @@ module Linguist
251
284
  end
252
285
  def generated_roxygen2?
253
286
  return false unless extname == '.Rd'
254
- return false unless lines.count > 1 return lines[0].include?("% Generated by roxygen2: do not edit by hand")
287
+ return false unless lines.count > 1
288
+
289
+ return lines[0].include?("% Generated by roxygen2: do not edit by hand")
255
290
  end
256
291
  def generated_jison?
257
292
  return false unless extname == '.js'
@@ -292,7 +327,9 @@ module Linguist
292
327
  def generated_visualstudio6?
293
328
  return false unless extname.downcase == '.dsp'
294
329
  lines.first(3).any? { |l| l.include? '# Microsoft Developer Studio Generated Build File' }
295
- end HAXE_EXTENSIONS = ['.js', '.py', '.lua', '.cpp', '.h', '.java', '.cs', '.php']
330
+ end
331
+
332
+ HAXE_EXTENSIONS = ['.js', '.py', '.lua', '.cpp', '.h', '.java', '.cs', '.php']
296
333
  def generated_haxe?
297
334
  return false unless HAXE_EXTENSIONS.include?(extname)
298
335
  return lines.first(3).any? { |l| l.include?("Generated by Haxe") }
@@ -332,6 +369,13 @@ module Linguist
332
369
  def generated_pascal_tlb?
333
370
  !!name.match(/_tlb\.pas$/i)
334
371
  end
372
+ def generated_sorbet_rbi?
373
+ return false unless extname.downcase == '.rbi'
374
+ return false unless lines.count >= 5
375
+ lines[0].match?(/^# typed:/) &&
376
+ lines[2].include?("DO NOT EDIT MANUALLY") &&
377
+ lines[4].match?(/^# Please.*run.*`.*tapioca/)
378
+ end
335
379
  def extract_html_meta(match)
336
380
  (match.last.sub(/\/\Z/, "").strip.scan(/
337
381
  (?<=^|\s)
@@ -348,4 +392,4 @@ module Linguist
348
392
  end.select { |x| x.length == 2 }.to_h
349
393
  end
350
394
  end
351
- end
395
+ end
@@ -67,6 +67,16 @@ disambiguations:
67
67
  pattern: '^\s*(# |include|require)\b'
68
68
  - language: Clojure
69
69
  pattern: '\((def|defn|defmacro|let)\s'
70
+ - extensions: ['.bf']
71
+ rules:
72
+ - language: Beef
73
+ pattern: '(?-m)^\s*using\s+(System|Beefy)(\.(.*))?;\s*$'
74
+ - language: HyPhy
75
+ pattern:
76
+ - '(?-m)^\s*#include\s+".*";\s*$'
77
+ - '\sfprintf\s*\('
78
+ - language: Brainfuck
79
+ pattern: '(>\+>|>\+<)'
70
80
  - extensions: ['.bi']
71
81
  rules:
72
82
  - language: FreeBasic
@@ -99,6 +109,12 @@ disambiguations:
99
109
  pattern: '\/\* |\/\/ |^\}'
100
110
  - extensions: ['.cls']
101
111
  rules:
112
+ - language: Visual Basic 6.0
113
+ and:
114
+ - named_pattern: vb-class
115
+ - pattern: '^\s*BEGIN\R\s*MultiUse\s*=.*\R\s*Persistable\s*='
116
+ - language: VBA
117
+ named_pattern: vb-class
102
118
  - language: TeX
103
119
  pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass){'
104
120
  - language: ObjectScript
@@ -112,7 +128,7 @@ disambiguations:
112
128
  - language: Smalltalk
113
129
  pattern: '![\w\s]+methodsFor: '
114
130
  - language: 'C#'
115
- pattern: '^(\s*namespace\s*[\w\.]+\s*({|;)|\s*\/\/)'
131
+ pattern: '^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*({|;)|\/\/)'
116
132
  - extensions: ['.csc']
117
133
  rules:
118
134
  - language: GSC
@@ -193,6 +209,16 @@ disambiguations:
193
209
  - language: Frege
194
210
  pattern: '^\s*(import|module|package|data|type) '
195
211
  - language: Text
212
+ - extensions: ['.frm']
213
+ rules:
214
+ - language: VBA
215
+ and:
216
+ - named_pattern: vb-form
217
+ - pattern: '^\s*Begin\s+{[0-9A-Z\-]*}\s?'
218
+ - language: Visual Basic 6.0
219
+ and:
220
+ - named_pattern: vb-form
221
+ - pattern: '^\s*Begin\s+VB\.Form\s+'
196
222
  - extensions: ['.fs']
197
223
  rules:
198
224
  - language: Forth
@@ -209,6 +235,12 @@ disambiguations:
209
235
  pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\${\w+[^\n]*?}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
210
236
  - language: Fluent
211
237
  pattern: '^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}'
238
+ - extensions: ['.g']
239
+ rules:
240
+ - language: GAP
241
+ pattern: '\s*(Declare|BindGlobal|KeyDependentOperation|Install(Method|GlobalFunction)|SetPackageInfo)'
242
+ - language: G-code
243
+ pattern: '^[MG][0-9]+\n'
212
244
  - extensions: ['.gd']
213
245
  rules:
214
246
  - language: GAP
@@ -251,6 +283,11 @@ disambiguations:
251
283
  rules:
252
284
  - language: Hack
253
285
  pattern: '<\?hh'
286
+ - extensions: ['.html']
287
+ rules:
288
+ - language: Ecmarkup
289
+ pattern: '<emu-(?:alg|annex|biblio|clause|eqn|example|figure|gann|gmod|gprose|grammar|intro|not-ref|note|nt|prodref|production|rhs|table|t|xref)(?:$|\s|>)'
290
+ - language: HTML
254
291
  - extensions: ['.i']
255
292
  rules:
256
293
  - language: Motorola 68K Assembly
@@ -286,6 +323,13 @@ disambiguations:
286
323
  pattern:
287
324
  - '(?i:^\s*{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+})'
288
325
  - '^\s*end[.;]\s*$'
326
+ - extensions: ['.json']
327
+ rules:
328
+ - language: OASv2-json
329
+ pattern: '"swagger":\s?"2.[0-9.]+"'
330
+ - language: OASv3-json
331
+ pattern: '"openapi":\s?"3.[0-9.]+"'
332
+ - language: JSON
289
333
  - extensions: ['.l']
290
334
  rules:
291
335
  - language: Common Lisp
@@ -424,7 +468,7 @@ disambiguations:
424
468
  - extensions: ['.plist']
425
469
  rules:
426
470
  - language: XML Property List
427
- pattern: '<!DOCTYPE\s+plist'
471
+ pattern: '^\s*(?:<\?xml\s|<!DOCTYPE\s+plist|<plist(?:\s+version\s*=\s*(["''])\d+(?:\.\d+)?\1)?\s*>\s*$)'
428
472
  - language: OpenStep Property List
429
473
  - extensions: ['.pm']
430
474
  rules:
@@ -458,7 +502,7 @@ disambiguations:
458
502
  - pattern: HEADERS
459
503
  - pattern: SOURCES
460
504
  - language: IDL
461
- pattern: '^\s*function[ \w,]+$'
505
+ pattern: '^\s*(?i:function|pro|compile_opt) \w[ \w,:]*$'
462
506
  - extensions: ['.properties']
463
507
  rules:
464
508
  - language: INI
@@ -537,6 +581,12 @@ disambiguations:
537
581
  pattern: '(?i:\^(this|super)\.|^\s*~\w+\s*=\.)'
538
582
  - language: Scala
539
583
  pattern: '(^\s*import (scala|java)\.|^\s*class\b)'
584
+ - extensions: ['.scd']
585
+ rules:
586
+ - language: SuperCollider
587
+ pattern: '(?i:\^(this|super)\.|^\s*(~\w+\s*=\.|SynthDef\b))'
588
+ - language: Markdown
589
+ pattern: '^#+\s+(NAME|SYNOPSIS|DESCRIPTION)'
540
590
  - extensions: ['.sol']
541
591
  rules:
542
592
  - language: Solidity
@@ -581,6 +631,10 @@ disambiguations:
581
631
  pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
582
632
  - language: Turing
583
633
  pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
634
+ - extensions: ['.tag']
635
+ rules:
636
+ - language: Java Server Pages
637
+ pattern: '<%[@!=\s]?\s*(taglib|tag|include|attribute|variable)\s'
584
638
  - extensions: ['.toc']
585
639
  rules:
586
640
  - language: World of Warcraft Addon Data
@@ -607,6 +661,27 @@ disambiguations:
607
661
  rules:
608
662
  - language: Vim Help File
609
663
  pattern: '(?:(?:^|[ \t])(?:vi|Vi(?=m))(?:m[<=>]?[0-9]+|m)?|[ \t]ex)(?=:(?=[ \t]*set?[ \t][^\r\n:]+:)|:(?![ \t]*set?[ \t]))(?:(?:[ \t]*:[ \t]*|[ \t])\w*(?:[ \t]*=(?:[^\\\s]|\\.)*)?)*[ \t:](?:filetype|ft|syntax)[ \t]*=(help)(?=$|\s|:)'
664
+ - language: Adblock Filter List
665
+ pattern: |-
666
+ (?x)\A
667
+ \[
668
+ (?<version>
669
+ (?:
670
+ [Aa]d[Bb]lock
671
+ (?:[ \t][Pp]lus)?
672
+ |
673
+ u[Bb]lock
674
+ (?:[ \t][Oo]rigin)?
675
+ |
676
+ [Aa]d[Gg]uard
677
+ )
678
+ (?:[ \t] \d+(?:\.\d+)*+)?
679
+ )
680
+ (?:
681
+ [ \t]?;[ \t]?
682
+ \g<version>
683
+ )*+
684
+ \]
610
685
  - language: Text
611
686
  - extensions: ['.url']
612
687
  rules:
@@ -641,11 +716,15 @@ disambiguations:
641
716
  pattern: '^%(end|ctor|hook|group)\b'
642
717
  - language: Linker Script
643
718
  pattern: 'OUTPUT_ARCH\(|OUTPUT_FORMAT\(|SECTIONS'
644
- - extensions: ['.yaml']
719
+ - extensions: ['.yaml', '.yml']
645
720
  rules:
646
721
  - language: MiniYAML
647
722
  pattern: '^\t+.*?[^\s:].*?:'
648
723
  negative_pattern: '---'
724
+ - language: OASv2-yaml
725
+ pattern: 'swagger:\s?''?"?2.[0-9.]+''?"?'
726
+ - language: OASv3-yaml
727
+ pattern: 'openapi:\s?''?"?3.[0-9.]+''?"?'
649
728
  - language: YAML
650
729
  - extensions: ['.yy']
651
730
  rules:
@@ -688,3 +767,5 @@ named_patterns:
688
767
  objectivec: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
689
768
  perl5: '\buse\s+(?:strict\b|v?5\.)'
690
769
  perl6: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
770
+ vb-class: '^\s*VERSION\s+[0-9]\.[0-9]\s+CLASS'
771
+ vb-form: '^\s*VERSION\s+[0-9]\.[0-9]{2}'
package/ext/languages.yml CHANGED
@@ -192,6 +192,19 @@ Ada:
192
192
  tm_scope: source.ada
193
193
  ace_mode: ada
194
194
  language_id: 11
195
+ Adblock Filter List:
196
+ type: data
197
+ color: "#800000"
198
+ ace_mode: text
199
+ extensions:
200
+ - ".txt"
201
+ aliases:
202
+ - ad block filters
203
+ - ad block
204
+ - adb
205
+ - adblock
206
+ tm_scope: text.adblock
207
+ language_id: 884614762
195
208
  Adobe Font Metrics:
196
209
  type: data
197
210
  color: "#fa0f00"
@@ -366,6 +379,7 @@ Assembly:
366
379
  - ".a51"
367
380
  - ".i"
368
381
  - ".inc"
382
+ - ".nas"
369
383
  - ".nasm"
370
384
  tm_scope: source.assembly
371
385
  ace_mode: assembly_x86
@@ -492,6 +506,7 @@ Befunge:
492
506
  type: programming
493
507
  extensions:
494
508
  - ".befunge"
509
+ - ".bf"
495
510
  tm_scope: source.befunge
496
511
  ace_mode: text
497
512
  language_id: 30
@@ -1294,6 +1309,15 @@ Cycript:
1294
1309
  codemirror_mode: javascript
1295
1310
  codemirror_mime_type: text/javascript
1296
1311
  language_id: 78
1312
+ Cypher:
1313
+ type: programming
1314
+ color: "#34c0eb"
1315
+ extensions:
1316
+ - ".cyp"
1317
+ - ".cypher"
1318
+ tm_scope: source.cypher
1319
+ ace_mode: text
1320
+ language_id: 850806976
1297
1321
  Cython:
1298
1322
  type: programming
1299
1323
  color: "#fedf5b"
@@ -1610,10 +1634,25 @@ Ecere Projects:
1610
1634
  codemirror_mode: javascript
1611
1635
  codemirror_mime_type: application/json
1612
1636
  language_id: 98
1637
+ Ecmarkup:
1638
+ type: markup
1639
+ color: "#eb8131"
1640
+ group: HTML
1641
+ extensions:
1642
+ - ".html"
1643
+ tm_scope: text.html.ecmarkup
1644
+ ace_mode: html
1645
+ codemirror_mode: htmlmixed
1646
+ codemirror_mime_type: text/html
1647
+ aliases:
1648
+ - ecmarkdown
1649
+ language_id: 844766630
1613
1650
  EditorConfig:
1614
1651
  type: data
1615
1652
  color: "#fff1f2"
1616
1653
  group: INI
1654
+ extensions:
1655
+ - ".editorconfig"
1617
1656
  filenames:
1618
1657
  - ".editorconfig"
1619
1658
  aliases:
@@ -1665,6 +1704,16 @@ Elm:
1665
1704
  codemirror_mode: elm
1666
1705
  codemirror_mime_type: text/x-elm
1667
1706
  language_id: 101
1707
+ Elvish:
1708
+ type: programming
1709
+ ace_mode: text
1710
+ extensions:
1711
+ - ".elv"
1712
+ interpreters:
1713
+ - elvish
1714
+ tm_scope: source.elvish
1715
+ color: "#55BB55"
1716
+ language_id: 570996448
1668
1717
  Emacs Lisp:
1669
1718
  type: programming
1670
1719
  tm_scope: source.emacs.lisp
@@ -2095,6 +2144,17 @@ Gemfile.lock:
2095
2144
  filenames:
2096
2145
  - Gemfile.lock
2097
2146
  language_id: 907065713
2147
+ Gemini:
2148
+ type: prose
2149
+ color: "#ff6900"
2150
+ ace_mode: text
2151
+ extensions:
2152
+ - ".gmi"
2153
+ aliases:
2154
+ - gemtext
2155
+ wrap: true
2156
+ tm_scope: source.gemini
2157
+ language_id: 310828396
2098
2158
  Genero:
2099
2159
  type: programming
2100
2160
  color: "#63408e"
@@ -2459,6 +2519,14 @@ HLSL:
2459
2519
  ace_mode: text
2460
2520
  tm_scope: source.hlsl
2461
2521
  language_id: 145
2522
+ HOCON:
2523
+ type: data
2524
+ color: "#9ff8ee"
2525
+ extensions:
2526
+ - ".hocon"
2527
+ tm_scope: source.hocon
2528
+ ace_mode: text
2529
+ language_id: 679725279
2462
2530
  HTML:
2463
2531
  type: markup
2464
2532
  tm_scope: text.html.basic
@@ -2789,6 +2857,14 @@ ImageJ Macro:
2789
2857
  ace_mode: text
2790
2858
  tm_scope: none
2791
2859
  language_id: 575143428
2860
+ Imba:
2861
+ type: programming
2862
+ color: "#16cec6"
2863
+ extensions:
2864
+ - ".imba"
2865
+ ace_mode: text
2866
+ tm_scope: source.imba
2867
+ language_id: 1057618448
2792
2868
  Inform 7:
2793
2869
  type: programming
2794
2870
  wrap: true
@@ -2801,6 +2877,14 @@ Inform 7:
2801
2877
  - inform7
2802
2878
  ace_mode: text
2803
2879
  language_id: 166
2880
+ Ink:
2881
+ type: programming
2882
+ wrap: true
2883
+ extensions:
2884
+ - ".ink"
2885
+ tm_scope: source.ink
2886
+ ace_mode: text
2887
+ language_id: 838252715
2804
2888
  Inno Setup:
2805
2889
  type: programming
2806
2890
  color: "#264b99"
@@ -2906,6 +2990,7 @@ JSON:
2906
2990
  - ".yy"
2907
2991
  - ".yyp"
2908
2992
  filenames:
2993
+ - ".all-contributorsrc"
2909
2994
  - ".arcconfig"
2910
2995
  - ".auto-changelog"
2911
2996
  - ".c8rc"
@@ -3019,6 +3104,7 @@ Java:
3019
3104
  extensions:
3020
3105
  - ".java"
3021
3106
  - ".jav"
3107
+ - ".jsh"
3022
3108
  language_id: 181
3023
3109
  Java Properties:
3024
3110
  type: data
@@ -3038,6 +3124,7 @@ Java Server Pages:
3038
3124
  - jsp
3039
3125
  extensions:
3040
3126
  - ".jsp"
3127
+ - ".tag"
3041
3128
  tm_scope: text.html.jsp
3042
3129
  ace_mode: jsp
3043
3130
  codemirror_mode: htmlembedded
@@ -3302,6 +3389,7 @@ Kusto:
3302
3389
  type: data
3303
3390
  extensions:
3304
3391
  - ".csl"
3392
+ - ".kql"
3305
3393
  tm_scope: source.kusto
3306
3394
  ace_mode: text
3307
3395
  language_id: 225697190
@@ -3859,6 +3947,17 @@ Mercury:
3859
3947
  - ".moo"
3860
3948
  tm_scope: source.mercury
3861
3949
  language_id: 229
3950
+ Mermaid:
3951
+ type: markup
3952
+ color: "#ff3670"
3953
+ aliases:
3954
+ - mermaid example
3955
+ extensions:
3956
+ - ".mmd"
3957
+ - ".mermaid"
3958
+ tm_scope: source.mermaid
3959
+ ace_mode: text
3960
+ language_id: 385992043
3862
3961
  Meson:
3863
3962
  type: programming
3864
3963
  color: "#007800"
@@ -3905,6 +4004,7 @@ MiniYAML:
3905
4004
  tm_scope: source.miniyaml
3906
4005
  extensions:
3907
4006
  - ".yaml"
4007
+ - ".yml"
3908
4008
  ace_mode: yaml
3909
4009
  codemirror_mode: yaml
3910
4010
  codemirror_mime_type: text/x-yaml
@@ -4027,6 +4127,14 @@ Motorola 68K Assembly:
4027
4127
  tm_scope: source.m68k
4028
4128
  ace_mode: assembly_x86
4029
4129
  language_id: 477582706
4130
+ Move:
4131
+ type: programming
4132
+ color: "#4a137a"
4133
+ extensions:
4134
+ - ".move"
4135
+ tm_scope: source.move
4136
+ ace_mode: text
4137
+ language_id: 638334599
4030
4138
  Muse:
4031
4139
  type: prose
4032
4140
  extensions:
@@ -4119,6 +4227,14 @@ NWScript:
4119
4227
  codemirror_mode: clike
4120
4228
  codemirror_mime_type: text/x-csrc
4121
4229
  language_id: 731233819
4230
+ Nasal:
4231
+ type: programming
4232
+ color: "#1d2c4e"
4233
+ extensions:
4234
+ - ".nas"
4235
+ tm_scope: none
4236
+ ace_mode: text
4237
+ language_id: 178322513
4122
4238
  Nearley:
4123
4239
  type: programming
4124
4240
  ace_mode: text
@@ -4284,6 +4400,52 @@ Nunjucks:
4284
4400
  tm_scope: text.html.nunjucks
4285
4401
  ace_mode: nunjucks
4286
4402
  language_id: 461856962
4403
+ OASv2-json:
4404
+ type: data
4405
+ color: "#85ea2d"
4406
+ extensions:
4407
+ - ".json"
4408
+ group: OpenAPI Specification v2
4409
+ tm_scope: source.json
4410
+ ace_mode: json
4411
+ codemirror_mode: javascript
4412
+ codemirror_mime_type: application/json
4413
+ language_id: 834374816
4414
+ OASv2-yaml:
4415
+ type: data
4416
+ color: "#85ea2d"
4417
+ extensions:
4418
+ - ".yaml"
4419
+ - ".yml"
4420
+ group: OpenAPI Specification v2
4421
+ tm_scope: source.yaml
4422
+ ace_mode: yaml
4423
+ codemirror_mode: yaml
4424
+ codemirror_mime_type: text/x-yaml
4425
+ language_id: 105187618
4426
+ OASv3-json:
4427
+ type: data
4428
+ color: "#85ea2d"
4429
+ extensions:
4430
+ - ".json"
4431
+ group: OpenAPI Specification v3
4432
+ tm_scope: source.json
4433
+ ace_mode: json
4434
+ codemirror_mode: javascript
4435
+ codemirror_mime_type: application/json
4436
+ language_id: 980062566
4437
+ OASv3-yaml:
4438
+ type: data
4439
+ color: "#85ea2d"
4440
+ extensions:
4441
+ - ".yaml"
4442
+ - ".yml"
4443
+ group: OpenAPI Specification v3
4444
+ tm_scope: source.yaml
4445
+ ace_mode: yaml
4446
+ codemirror_mode: yaml
4447
+ codemirror_mime_type: text/x-yaml
4448
+ language_id: 51239111
4287
4449
  OCaml:
4288
4450
  type: programming
4289
4451
  ace_mode: ocaml
@@ -4410,6 +4572,22 @@ Open Policy Agent:
4410
4572
  - ".rego"
4411
4573
  language_id: 840483232
4412
4574
  tm_scope: source.rego
4575
+ OpenAPI Specification v2:
4576
+ aliases:
4577
+ - oasv2
4578
+ type: data
4579
+ color: "#85ea2d"
4580
+ tm_scope: none
4581
+ ace_mode: text
4582
+ language_id: 848295328
4583
+ OpenAPI Specification v3:
4584
+ aliases:
4585
+ - oasv3
4586
+ type: data
4587
+ color: "#85ea2d"
4588
+ tm_scope: none
4589
+ ace_mode: text
4590
+ language_id: 557959099
4413
4591
  OpenCL:
4414
4592
  type: programming
4415
4593
  color: "#ed2e2d"
@@ -4481,6 +4659,21 @@ OpenType Feature File:
4481
4659
  tm_scope: source.opentype
4482
4660
  ace_mode: text
4483
4661
  language_id: 374317347
4662
+ Option List:
4663
+ type: data
4664
+ color: "#476732"
4665
+ aliases:
4666
+ - opts
4667
+ - ackrc
4668
+ filenames:
4669
+ - ".ackrc"
4670
+ - ackrc
4671
+ - mocha.opts
4672
+ tm_scope: source.opts
4673
+ ace_mode: sh
4674
+ codemirror_mode: shell
4675
+ codemirror_mime_type: text/x-sh
4676
+ language_id: 723589315
4484
4677
  Org:
4485
4678
  type: prose
4486
4679
  color: "#77aa99"
@@ -4525,6 +4718,14 @@ P4:
4525
4718
  tm_scope: source.p4
4526
4719
  ace_mode: text
4527
4720
  language_id: 348895984
4721
+ PDDL:
4722
+ type: programming
4723
+ color: "#0d00ff"
4724
+ extensions:
4725
+ - ".pddl"
4726
+ tm_scope: source.pddl
4727
+ ace_mode: text
4728
+ language_id: 736235603
4528
4729
  PEG.js:
4529
4730
  type: programming
4530
4731
  color: "#234d6b"
@@ -4717,10 +4918,12 @@ Perl:
4717
4918
  - ".psgi"
4718
4919
  - ".t"
4719
4920
  filenames:
4921
+ - ".latexmkrc"
4720
4922
  - Makefile.PL
4721
4923
  - Rexfile
4722
4924
  - ack
4723
4925
  - cpanfile
4926
+ - latexmkrc
4724
4927
  interpreters:
4725
4928
  - cperl
4726
4929
  - perl
@@ -4815,6 +5018,14 @@ PogoScript:
4815
5018
  tm_scope: source.pogoscript
4816
5019
  ace_mode: text
4817
5020
  language_id: 289
5021
+ Polar:
5022
+ type: programming
5023
+ color: "#ae81ff"
5024
+ extensions:
5025
+ - ".polar"
5026
+ tm_scope: source.polar
5027
+ ace_mode: text
5028
+ language_id: 839112914
4818
5029
  Pony:
4819
5030
  type: programming
4820
5031
  extensions:
@@ -5578,6 +5789,16 @@ Rouge:
5578
5789
  - ".rg"
5579
5790
  tm_scope: source.clojure
5580
5791
  language_id: 325
5792
+ RouterOS Script:
5793
+ type: programming
5794
+ ace_mode: text
5795
+ extensions:
5796
+ - ".rsc"
5797
+ interpreters:
5798
+ - RouterOS
5799
+ color: "#DE3941"
5800
+ tm_scope: none
5801
+ language_id: 592853203
5581
5802
  Ruby:
5582
5803
  type: programming
5583
5804
  tm_scope: source.ruby
@@ -5886,6 +6107,16 @@ Scaml:
5886
6107
  tm_scope: source.scaml
5887
6108
  ace_mode: text
5888
6109
  language_id: 342
6110
+ Scenic:
6111
+ type: programming
6112
+ color: "#fdc700"
6113
+ extensions:
6114
+ - ".scenic"
6115
+ tm_scope: source.scenic
6116
+ ace_mode: text
6117
+ interpreters:
6118
+ - scenic
6119
+ language_id: 619814037
5889
6120
  Scheme:
5890
6121
  type: programming
5891
6122
  color: "#1e4aec"
@@ -6048,6 +6279,19 @@ Sieve:
6048
6279
  codemirror_mode: sieve
6049
6280
  codemirror_mime_type: application/sieve
6050
6281
  language_id: 208976687
6282
+ Simple File Verification:
6283
+ type: data
6284
+ group: Checksums
6285
+ color: "#C9BFED"
6286
+ extensions:
6287
+ - ".sfv"
6288
+ aliases:
6289
+ - sfv
6290
+ tm_scope: source.sfv
6291
+ ace_mode: ini
6292
+ codemirror_mode: properties
6293
+ codemirror_mime_type: text/x-properties
6294
+ language_id: 735623761
6051
6295
  Singularity:
6052
6296
  type: programming
6053
6297
  color: "#64E6AD"
@@ -6122,6 +6366,16 @@ Smarty:
6122
6366
  codemirror_mime_type: text/x-smarty
6123
6367
  tm_scope: text.html.smarty
6124
6368
  language_id: 353
6369
+ Smithy:
6370
+ type: programming
6371
+ ace_mode: text
6372
+ codemirror_mode: clike
6373
+ codemirror_mime_type: text/x-csrc
6374
+ tm_scope: source.smithy
6375
+ color: "#c44536"
6376
+ extensions:
6377
+ - ".smithy"
6378
+ language_id: 1027892786
6125
6379
  Solidity:
6126
6380
  type: programming
6127
6381
  color: "#AA6746"
@@ -6204,6 +6458,7 @@ Starlark:
6204
6458
  - BUILD.bazel
6205
6459
  - Tiltfile
6206
6460
  - WORKSPACE
6461
+ - WORKSPACE.bazel
6207
6462
  aliases:
6208
6463
  - bazel
6209
6464
  - bzl
@@ -6252,7 +6507,6 @@ SugarSS:
6252
6507
  type: markup
6253
6508
  color: "#2fcc9f"
6254
6509
  tm_scope: source.css.postcss.sugarss
6255
- group: CSS
6256
6510
  extensions:
6257
6511
  - ".sss"
6258
6512
  ace_mode: text
@@ -6329,6 +6583,7 @@ TOML:
6329
6583
  - Cargo.lock
6330
6584
  - Gopkg.lock
6331
6585
  - Pipfile
6586
+ - pdm.lock
6332
6587
  - poetry.lock
6333
6588
  tm_scope: source.toml
6334
6589
  ace_mode: toml
@@ -6384,8 +6639,13 @@ Tcl:
6384
6639
  extensions:
6385
6640
  - ".tcl"
6386
6641
  - ".adp"
6642
+ - ".sdc"
6387
6643
  - ".tcl.in"
6388
6644
  - ".tm"
6645
+ - ".xdc"
6646
+ aliases:
6647
+ - sdc
6648
+ - xdc
6389
6649
  filenames:
6390
6650
  - owh
6391
6651
  - starfield
@@ -6685,12 +6945,9 @@ VBA:
6685
6945
  - ".bas"
6686
6946
  - ".cls"
6687
6947
  - ".frm"
6688
- - ".frx"
6689
6948
  - ".vba"
6690
6949
  tm_scope: source.vbnet
6691
6950
  aliases:
6692
- - vb6
6693
- - visual basic 6
6694
6951
  - visual basic for applications
6695
6952
  ace_mode: text
6696
6953
  codemirror_mode: vb
@@ -6751,6 +7008,19 @@ Valve Data Format:
6751
7008
  ace_mode: text
6752
7009
  tm_scope: source.keyvalues
6753
7010
  language_id: 544060961
7011
+ Velocity Template Language:
7012
+ type: markup
7013
+ color: "#507cff"
7014
+ aliases:
7015
+ - vtl
7016
+ - velocity
7017
+ extensions:
7018
+ - ".vtl"
7019
+ ace_mode: velocity
7020
+ tm_scope: source.velocity
7021
+ codemirror_mode: velocity
7022
+ codemirror_mime_type: text/velocity
7023
+ language_id: 292377326
6754
7024
  Verilog:
6755
7025
  type: programming
6756
7026
  color: "#b2b7f8"
@@ -6828,6 +7098,25 @@ Visual Basic .NET:
6828
7098
  codemirror_mode: vb
6829
7099
  codemirror_mime_type: text/x-vb
6830
7100
  language_id: 389
7101
+ Visual Basic 6.0:
7102
+ type: programming
7103
+ color: "#2c6353"
7104
+ extensions:
7105
+ - ".cls"
7106
+ - ".ctl"
7107
+ - ".Dsr"
7108
+ - ".frm"
7109
+ tm_scope: source.vbnet
7110
+ aliases:
7111
+ - vb6
7112
+ - vb 6
7113
+ - visual basic 6
7114
+ - visual basic classic
7115
+ - classic visual basic
7116
+ ace_mode: text
7117
+ codemirror_mode: vb
7118
+ codemirror_mime_type: text/x-vb
7119
+ language_id: 679594952
6831
7120
  Volt:
6832
7121
  type: programming
6833
7122
  color: "#1F1F1F"
@@ -6984,6 +7273,16 @@ World of Warcraft Addon Data:
6984
7273
  tm_scope: source.toc
6985
7274
  ace_mode: text
6986
7275
  language_id: 396
7276
+ Wren:
7277
+ type: programming
7278
+ color: "#383838"
7279
+ aliases:
7280
+ - wrenlang
7281
+ extensions:
7282
+ - ".wren"
7283
+ tm_scope: source.wren
7284
+ ace_mode: text
7285
+ language_id: 713580619
6987
7286
  X BitMap:
6988
7287
  type: data
6989
7288
  group: C
@@ -7116,6 +7415,7 @@ XML:
7116
7415
  - ".ps1xml"
7117
7416
  - ".psc1"
7118
7417
  - ".pt"
7418
+ - ".qhelp"
7119
7419
  - ".rdf"
7120
7420
  - ".res"
7121
7421
  - ".resx"
@@ -7492,6 +7792,16 @@ jq:
7492
7792
  - ".jq"
7493
7793
  tm_scope: source.jq
7494
7794
  language_id: 905371884
7795
+ just:
7796
+ type: programming
7797
+ aliases:
7798
+ - Justfile
7799
+ color: "#384d54"
7800
+ tm_scope: source.just
7801
+ filenames:
7802
+ - Justfile
7803
+ ace_mode: text
7804
+ language_id: 128447695
7495
7805
  kvlang:
7496
7806
  type: markup
7497
7807
  ace_mode: text
@@ -7630,4 +7940,4 @@ xBase:
7630
7940
  - ".prw"
7631
7941
  tm_scope: source.harbour
7632
7942
  ace_mode: text
7633
- language_id: 421
7943
+ language_id: 421
package/ext/vendor.yml CHANGED
@@ -29,7 +29,7 @@
29
29
  - (^|/)\.indent\.pro
30
30
  - (\.|-)min\.(js|css)$
31
31
  - ([^\s]*)import\.(css|less|scss|styl)$
32
- - (^|/)bootstrap([^/.]*)\.(js|css|less|scss|styl)$
32
+ - (^|/)bootstrap([^/.]*)(?=\.).*\.(js|css|less|scss|styl)$
33
33
  - (^|/)custom\.bootstrap([^\s]*)(js|css|less|scss|styl)$
34
34
  - (^|/)font-?awesome\.(css|less|scss|styl)$
35
35
  - (^|/)font-?awesome/.*\.(css|less|scss|styl)$
@@ -103,7 +103,9 @@
103
103
  - (^|/)env/
104
104
  - (^|/)fabfile\.py$
105
105
  - (^|/)waf$
106
- - (^|/)\.osx$- \.xctemplate/
106
+ - (^|/)\.osx$
107
+
108
+ - \.xctemplate/
107
109
  - \.imageset/
108
110
  - (^|/)Carthage/
109
111
  - (^|/)Sparkle/
@@ -151,7 +153,6 @@
151
153
  - (^|/)foundation(\..*)?\.js$
152
154
  - (^|/)Vagrantfile$
153
155
  - (^|/)\.[Dd][Ss]_[Ss]tore$
154
- - (^|/)vignettes/
155
156
  - (^|/)inst/extdata/
156
157
  - (^|/)octicons\.css
157
158
  - (^|/)sprockets-octicons\.scss
@@ -163,4 +164,4 @@
163
164
  - (^|/)\.google_apis/
164
165
  - (^|/)Jenkinsfile$
165
166
  - (^|/)\.gitpod\.Dockerfile$
166
- - (^|/)\.github/
167
+ - (^|/)\.github/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linguist-js",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "scripts": {
14
14
  "download-files": "npx tsx@2 build/download-files",
15
- "prepare": "npm run download-files && npm test && npm run perf",
16
- "perf": "tsc && node test/perf",
15
+ "pre-publish": "npm run download-files && npm test && npm run test:perf",
16
+ "test:perf": "tsc && node test/perf",
17
17
  "test": "tsc && node test/folder && echo --- && node test/unit"
18
18
  },
19
19
  "files": [
@@ -40,18 +40,18 @@
40
40
  "homepage": "https://github.com/Nixinova/Linguist#readme",
41
41
  "dependencies": {
42
42
  "binary-extensions": "^2.2.0",
43
- "commander": "^9.3.0",
43
+ "commander": "^9.5.0",
44
44
  "common-path-prefix": "^3.0.0",
45
45
  "cross-fetch": "^3.1.5",
46
- "ignore": "^5.2.0",
47
- "isbinaryfile": "^4.0.8",
46
+ "ignore": "^5.2.4",
47
+ "isbinaryfile": "^4.0.8 <5",
48
48
  "js-yaml": "^4.1.0",
49
49
  "node-cache": "^5.1.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/js-yaml": "^4.0.5",
53
- "@types/node": "ts4.7",
54
- "deep-object-diff": "^1.1.7",
55
- "typescript": "~4.7.4"
53
+ "@types/node": "ts4.9",
54
+ "deep-object-diff": "^1.1.9",
55
+ "typescript": "~4.9.4"
56
56
  }
57
57
  }