Skip to content

Commit dd3bbc1

Browse files
authored
feat: improve XML languages detection (#284)
1 parent 21ffd92 commit dd3bbc1

File tree

5 files changed

+99
-108
lines changed

5 files changed

+99
-108
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,13 @@ class Extractor : ExtractorInterface {
1515
val TYPE_SYNTAX = 4
1616
val SEPARATOR = ">"
1717
val RESTRICTED_EXTS = listOf(".min.js")
18-
19-
fun getAllExtensions(): HashSet<String> {
20-
return Heuristics
21-
.map { (ext, _) -> ext }
22-
.toHashSet()
23-
}
2418
}
2519

2620
override fun extract(files: List<DiffFile>): List<CommitStats> {
2721
return files
2822
.filter { file -> !RESTRICTED_EXTS.contains(file.extension) }
2923
.mapNotNull { file ->
30-
val extractor = Heuristics.get(file.extension)
31-
if (extractor != null) extractor(file.new.content)?.extract(listOf(file))
32-
else null
24+
Heuristics.analyze(file)
3325
}
3426
.fold(mutableListOf()) { accStats, stats ->
3527
accStats.addAll(stats)

0 commit comments

Comments
 (0)