Skip to content

Commit 3bebf49

Browse files
asurkovanatolystansler
authored andcommitted
chore: exclude recognized languages from todos (#282)
1 parent b0cd307 commit 3bebf49

File tree

4 files changed

+96
-43
lines changed

4 files changed

+96
-43
lines changed

src/main/kotlin/app/extractors/Heuristics.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ val Heuristics = mapOf<String, (List<String>) -> ExtractorInterface?>(
506506
},
507507
"rpy" to { lines ->
508508
if (PythonRegex.matches(toBuf(lines))) CommonExtractor("python")
509-
else CommonExtractor("Ren'Py")
509+
else CommonExtractor("renpy")
510510
},
511511
"rs" to { lines ->
512512
val buf = toBuf(lines)

src/test/kotlin/test/tests/extractors/DirToLangMap.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
package test.tests.extractors
55

6-
// TODO(anatoly): Map all supported languages.
6+
// Special cases, when language code name is not a dir name in lower case.
77
val dirToLangMap = mapOf(
8-
"C" to "c",
98
"C#" to "csharp",
109
"C++" to "cpp",
11-
"CSS" to "css"
10+
"Ren'Py" to "renpy"
1211
)

src/test/kotlin/test/tests/extractors/HeuristicsTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ class HeuristicsTest : Spek({
4949
given("heuristics test") {
5050
it("all language samples") {
5151
for (dir in File(LANG_SAMPLES_PATH).listFiles()) {
52-
val expectedLang = dirToLangMap.getOrDefault(dir.name, dir.name)
52+
val expectedLang = dirToLangMap.getOrDefault(
53+
dir.name, dir.name.toLowerCase()
54+
)
5355
for (file in dir.walkTopDown()) {
5456
if (file.isFile) assertLang(file, expectedLang)
5557
}

src/test/kotlin/test/tests/extractors/IgnoredSamplesWildcards.kt

Lines changed: 90 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ var ignoredSamplesWildcards = listOf(
1414
"*/Apex/*",
1515
"*/APL/*",
1616
"*/API Blueprint/*",
17-
"*/AngelScript/*",
1817
"*/Alloy/*",
1918
"*/Apollo Guidance Computer/*",
2019
"*/ASN.1/*",
2120
"*/Awk/*",
2221
"*/Ant Build System/*",
23-
"*/Assembly/*",
22+
"*/Assembly/*.inc",
23+
"*/Assembly/*.a51",
24+
"*/Assembly/*.nasm",
2425
"*/Alpine Abuild/*",
2526
"*/AspectJ/*",
2627
"*/AMPL/*",
@@ -52,7 +53,7 @@ var ignoredSamplesWildcards = listOf(
5253
"*/CartoCSS/*.mss",
5354
"*/CLIPS/*",
5455
"*/CMake/*",
55-
"*/COBOL/*",
56+
"*/COBOL/*.ccp",
5657
"*/CSON/*",
5758
"*/CSV/*",
5859
"*/CWeb/*",
@@ -64,10 +65,16 @@ var ignoredSamplesWildcards = listOf(
6465
"*/Clarion/*",
6566
"*/Clean/*",
6667
"*/Click/*",
67-
"*/Clojure/*",
68+
"*/Clojure/*.hic",
69+
"*/Clojure/*.boot",
70+
"*/Clojure/*.cljx",
71+
"*/Clojure/*.hl",
72+
"*/Clojure/*.cljscm",
73+
"*/Clojure/*.cl2",
6874
"*/Closure Templates/*",
6975
"*/CoNLL-U/*",
70-
"*/CoffeeScript/*",
76+
"*/CoffeeScript/*.cake",
77+
"*/CoffeeScript/*.cjsx",
7178
"*/ColdFusion/*",
7279
"*/ColdFusion CFC/*",
7380
"*/Common Lisp/*",
@@ -80,7 +87,6 @@ var ignoredSamplesWildcards = listOf(
8087
"*/Csound/*",
8188
"*/Csound Document/*",
8289
"*/Csound Score/*",
83-
"*/Cuda/*",
8490
"*/Cycript/*",
8591
"*/D/*",
8692
"*/DIGITAL Command Language/*",
@@ -103,17 +109,30 @@ var ignoredSamplesWildcards = listOf(
103109
"*/Edje Data Collection/*",
104110
"*/Eiffel/*",
105111
"*/Elixir/*",
106-
"*/Elm/*",
107112
"*/Emacs Lisp/*",
108113
"*/EmberScript/*",
109-
"*/Erlang/*",
114+
"*/Erlang/*.es",
115+
"*/Erlang/*.src",
116+
"*/Erlang/*.escript",
117+
"*/Erlang/factorial",
118+
"*/Erlang/release",
119+
"*/Erlang/*.xrl",
120+
"*/Erlang/filenames/*",
121+
"*/Erlang/*.yrl",
110122
"*/F#/*",
111123
"*/FLUX/*",
112124
"*/Fantom/*",
113125
"*/Filebench WML/*",
114126
"*/Filterscript/*",
115127
"*/Formatted/*",
116-
"*/Forth/*",
128+
"*/Forth/*.f",
129+
"*/Forth/*.fth",
130+
"*/Forth/*.for",
131+
"*/Forth/*.frt",
132+
"*/Forth/*.4TH",
133+
"*/Forth/*.F",
134+
"*/Forth/*.fr",
135+
"*/Forth/*.fs",
117136
"*/Fortran/*",
118137
"*/FreeMarker/*",
119138
"*/Frege/*",
@@ -129,11 +148,9 @@ var ignoredSamplesWildcards = listOf(
129148
"*/Genie/*",
130149
"*/Gerber Image/*",
131150
"*/Gnuplot/*",
132-
"*/Go/*",
133151
"*/Golo/*",
134152
"*/Gosu/*",
135153
"*/Grace/*",
136-
"*/Gradle/*",
137154
"*/Grammatical Framework/*",
138155
"*/Graph Modeling Language/*",
139156
"*/GraphQL/*",
@@ -142,48 +159,58 @@ var ignoredSamplesWildcards = listOf(
142159
"*/Groovy Server Pages/*",
143160
"*/HCL/*",
144161
"*/HLSL/*",
145-
"*/HTML/*",
162+
"*/HTML/*.inc",
163+
"*/HTML/*.hl",
164+
"*/HTML/*.st",
165+
"*/HTML/*.xht",
146166
"*/HTML+Django/*",
147167
"*/HTML+ECR/*",
148168
"*/HTML+EEX/*",
149169
"*/HTML+ERB/*",
150170
"*/HXML/*",
151-
"*/Hack/*",
171+
"*/Hack/*.hh",
152172
"*/Haml/*",
153173
"*/Handlebars/*",
154-
"*/Haskell/*",
155-
"*/Hy/*",
156174
"*/HyPhy/*",
157175
"*/IDL/*",
158176
"*/IGOR Pro/*",
159-
"*/INI/*",
177+
"*/INI/filenames/*",
160178
"*/Idris/*",
161179
"*/Inform 7/*",
162180
"*/Inno Setup/*",
163181
"*/Ioke/*",
164182
"*/Isabelle/*",
165183
"*/Isabelle ROOT/*",
166-
"*/J/*",
184+
"*/J/hashbang",
167185
"*/JFlex/*",
168186
"*/JSON/*",
169187
"*/JSON5/*",
170188
"*/JSONLD/*",
171189
"*/JSONiq/*",
172190
"*/JSX/*",
173191
"*/Jasmin/*",
174-
"*/Java/*",
175-
"*/JavaScript/*",
192+
"*/JavaScript/*.mjs",
193+
"*/JavaScript/*.xsjs",
194+
"*/JavaScript/*.jscad",
195+
"*/JavaScript/js",
196+
"*/JavaScript/jquery-1.4.2.min.js",
197+
"*/JavaScript/jquery-1.6.1.min.js",
198+
"*/JavaScript/*.gs",
199+
"*/JavaScript/*.es",
200+
"*/JavaScript/*.jsb",
201+
"*/JavaScript/*.frag",
202+
"*/JavaScript/*.xsjslib",
203+
"*/JavaScript/js2",
176204
"*/Jison/*",
177205
"*/Jison Lex/*",
178206
"*/Jolie/*",
179-
"*/Julia/*",
207+
"*/Julia/julia",
180208
"*/Jupyter Notebook/*",
181209
"*/KRL/*",
182210
"*/KiCad Layout/*",
183211
"*/KiCad Legacy Layout/*",
184212
"*/KiCad Schematic/*",
185213
"*/Kit/*",
186-
"*/Kotlin/*",
187214
"*/LFE/*",
188215
"*/LOLCODE/*",
189216
"*/LSL/*",
@@ -221,7 +248,7 @@ var ignoredSamplesWildcards = listOf(
221248
"*/Maven POM/*",
222249
"*/Max/*",
223250
"*/MediaWiki/*",
224-
"*/Mercury/*",
251+
"*/Mercury/expr.moo",
225252
"*/Meson/*",
226253
"*/Metal/*",
227254
"*/Modelica/*",
@@ -258,11 +285,14 @@ var ignoredSamplesWildcards = listOf(
258285
"*/OpenSCAD/*",
259286
"*/Org/*",
260287
"*/Ox/*",
261-
"*/Oxygene/*",
262288
"*/Oz/*",
263289
"*/P4/*",
264290
"*/PAWN/*",
265-
"*/PHP/*",
291+
"*/PHP/*.inc",
292+
"*/PHP/*.fcgi",
293+
"*/PHP/php*",
294+
"*/PHP/filenames/.php_cs",
295+
"*/PHP/filenames/.php_cs.dist",
266296
"*/POV-Ray SDL/*",
267297
"*/Pan/*",
268298
"*/Papyrus/*",
@@ -283,19 +313,27 @@ var ignoredSamplesWildcards = listOf(
283313
"*/PostCSS/*",
284314
"*/PostScript/*",
285315
"*/PowerBuilder/*",
286-
"*/PowerShell/*",
287-
"*/Processing/*",
288316
"*/Prolog/*",
289317
"*/Propeller Spin/*",
290318
"*/Protocol Buffer/*",
291319
"*/Public Key/*",
292320
"*/Pug/*",
293-
"*/Puppet/*",
294321
"*/PureBasic/*",
295322
"*/PureScript/*",
296-
"*/Python/*",
323+
"*/Python/*.pyi",
324+
"*/Python/*.rpy",
325+
"*/Python/python*",
326+
"*/Python/*.gypi",
327+
"*/Python/filenames/*",
328+
"*/Python/*.spec",
329+
"*/Python/*.pyde",
330+
"*/Python/*.cgi",
331+
"*/Python/*.bzl",
332+
"*/Python/*.pyp",
333+
"*/Python/*.fcgi",
297334
"*/QML/*",
298-
"*/QMake/*",
335+
"*/QMake/qmake",
336+
"*/QMake/functions.pri",
299337
"*/R/*",
300338
"*/RAML/*",
301339
"*/RDoc/*",
@@ -315,9 +353,17 @@ var ignoredSamplesWildcards = listOf(
315353
"*/Ring/*",
316354
"*/RobotFramework/*",
317355
"*/Roff/*",
318-
"*/Ruby/*",
356+
"*/Ruby/*spec",
357+
"*/Ruby/rexpl",
358+
"*/Ruby/ruby*",
359+
"*/Ruby/*jbuilder",
360+
"*/Ruby/filenames/*",
361+
"*/Ruby/*.fcgi",
362+
"*/Ruby/*.rabl",
363+
"*/Ruby/macruby",
364+
"*/Ruby/*.rake",
365+
"*/Ruby/shoes-swt",
319366
"*/Rust/*",
320-
"*/SAS/*",
321367
"*/SCSS/*",
322368
"*/SMT/*",
323369
"*/SPARQL/*",
@@ -338,13 +384,23 @@ var ignoredSamplesWildcards = listOf(
338384
"*/Scheme/*",
339385
"*/Scilab/*",
340386
"*/ShaderLab/*",
341-
"*/Shell/*",
387+
"*/Shell/*.command",
388+
"*/Shell/*zsh",
389+
"*/Shell/99-bottles-of-beer",
390+
"*/Shell/*cgi",
391+
"*/Shell/plugin",
392+
"*/Shell/*bash",
393+
"*/Shell/sh",
394+
"*/Shell/filenames/*",
395+
"*/Shell/sbt",
396+
"*/Shell/*.tool",
397+
"*/Shell/string-chopping",
342398
"*/ShellSession/*",
343399
"*/Shen/*",
344400
"*/Slash/*",
345401
"*/Slim/*",
346402
"*/Smali/*",
347-
"*/Smalltalk/*",
403+
"*/Smalltalk/*.cs",
348404
"*/SourcePawn/*",
349405
"*/Squirrel/*",
350406
"*/Stan/*",
@@ -355,7 +411,6 @@ var ignoredSamplesWildcards = listOf(
355411
"*/Sublime Text Config/*",
356412
"*/SugarSS/*",
357413
"*/SuperCollider/*",
358-
"*/Swift/*",
359414
"*/SystemVerilog/*",
360415
"*/TI Program/*",
361416
"*/TLA/*",
@@ -370,19 +425,17 @@ var ignoredSamplesWildcards = listOf(
370425
"*/Turing/*",
371426
"*/Turtle/*",
372427
"*/Type Language/*",
373-
"*/TypeScript/*",
428+
"*/TypeScript/*.tsx",
374429
"*/Unity3D Asset/*",
375430
"*/Unix Assembly/*",
376431
"*/Uno/*",
377432
"*/UnrealScript/*",
378433
"*/UrWeb/*",
379434
"*/VCL/*",
380435
"*/VHDL/*",
381-
"*/Verilog/*",
382436
"*/Vim script/*",
383437
"*/Visual Basic/*",
384438
"*/Volt/*",
385-
"*/Vue/*",
386439
"*/Wavefront Material/*",
387440
"*/Wavefront Object/*",
388441
"*/Web Ontology Language/*",
@@ -400,7 +453,6 @@ var ignoredSamplesWildcards = listOf(
400453
"*/XS/*",
401454
"*/XSLT/*",
402455
"*/Xojo/*",
403-
"*/Xtend/*",
404456
"*/YAML/*",
405457
"*/YANG/*",
406458
"*/YARA/*",

0 commit comments

Comments
 (0)