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

@@ -24,12 +24,12 @@ class TestParserRegistry:
def test_all_parsers_registered(self):
"""Test that all parsers are registered."""
assert len(PARSERS) == 35, f"Expected 35 parsers, got {len(PARSERS)}"
assert len(PARSERS) == 36, f"Expected 36 parsers, got {len(PARSERS)}"
def test_get_parser_names(self):
"""Test getting list of parser names."""
names = get_parser_names()
assert len(names) == 35
assert len(names) == 36
assert "scrape" in names
assert "github" in names
assert "package" in names
@@ -244,8 +244,8 @@ class TestBackwardCompatibility:
def test_command_count_matches(self):
"""Test that we have exactly 35 commands (25 original + 10 new source types)."""
assert len(PARSERS) == 35
assert len(get_parser_names()) == 35
assert len(PARSERS) == 36
assert len(get_parser_names()) == 36
if __name__ == "__main__":