feat: add Kotlin language support for codebase analysis (#287)

Adds full C3.x pipeline support for Kotlin (.kt, .kts):
- Language detection patterns (40+ weighted patterns for data/sealed classes, coroutines, companion objects, KMP, etc.)
- AST regex parser in code_analyzer.py (classes, objects, functions, extension functions, suspend functions)
- Dependency extraction for Kotlin import statements (with alias support)
- Design pattern adaptations (object→Singleton, companion→Factory, sealed→Strategy, data→Builder, Flow→Observer)
- Test example extraction for JUnit 4/5, Kotest, MockK, Spek
- Config detection for build.gradle.kts / settings.gradle.kts
- Extension maps registered in codebase_scraper, unified_codebase_analyzer, github_scraper, generate_router

Also fixes pre-existing parser count tests (35→36 for doctor command added in previous commit).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-03-28 23:25:12 +03:00
parent ea4fed0be4
commit 6fded977dd
16 changed files with 1994 additions and 901 deletions

View File

@@ -77,6 +77,7 @@ class ConfigFile:
"ini",
"python",
"javascript",
"kotlin-gradle",
"dockerfile",
"docker-compose",
]
@@ -215,6 +216,14 @@ class ConfigFileDetector:
"webpack.config.js",
],
},
"kotlin-gradle": {
"patterns": ["*.gradle.kts"],
"names": [
"build.gradle.kts",
"settings.gradle.kts",
"gradle.properties",
],
},
"dockerfile": {
"patterns": ["Dockerfile*"],
"names": ["Dockerfile", "Dockerfile.dev", "Dockerfile.prod"],
@@ -358,7 +367,13 @@ class ConfigFileDetector:
return "ci_cd_configuration"
# Package configs
if filename in ["package.json", "pyproject.toml", "cargo.toml"]:
if filename in [
"package.json",
"pyproject.toml",
"cargo.toml",
"build.gradle.kts",
"settings.gradle.kts",
]:
return "package_configuration"
# TypeScript/JavaScript configs