You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(cli): add kotlin.md and detect Kotlin from root build files #72
#65 proposed kotlin.md, but only java.md shipped. Detection maps build.gradle, build.gradle.kts, and pom.xml to java, and --lang has no kotlin value. As a result, Kotlin Gradle projects such as Android or Spring Boot are linked to java.md, which is condensed from the Google Java Style Guide. Some of its rules contradict Kotlin conventions. For example, "a source file holds exactly one top-level class" conflicts with Kotlin's guidance on grouping several top-level declarations in one file. @pleaseai/ast-grep-config already ships rules/kotlin, so only the guide and the detection are missing.
Proposal
Add packages/cli/rules/kotlin.md, condensed from the Kotlin coding conventions (kotlinlang.org) the same way java.md was condensed from the Google guide. Check the license first, and add attribution to NOTICE.md if it is required.
Add kotlin to LANGUAGES, so that --lang kotlin, the AGENTS block, guide sync, and doctor all pick it up.
Detect Kotlin from the project root only. The project is Kotlin when either of these holds:
build.gradle(.kts) or settings.gradle(.kts) applies the Kotlin plugin (org.jetbrains.kotlin, kotlin(, or libs.plugins.kotlin).
src/main/kotlin exists.
A Gradle or Maven project without those signals stays java. When Java sources are also present (src/main/java containing .java files), select both.
Activity