Repository navigation
Basic Java/Kotlin support: detection, tests, linters, build commands - #14
Merged
Merged
Conversation
Detect Java and Kotlin from a root Maven/Gradle build (or a significant share of JVM code) and score them in the existing checks: test command and test files, JVM linters (checkstyle/spotless/PMD/SpotBugs/Error Prone/ktlint/detekt), compile as typecheck, compiler-checked types. --fix generates Maven/Gradle commands; ./mvnw commands in docs are recognized; an untracked, unignored target/ is flagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: src/checks/feedback.ts (imports combined: JVM_BUILD/isFixturePath plus RunOptions/runCommand/isDangerousScript, and the now-unused spawnSync dropped; JVM helpers kept next to the --run lint/typecheck/testRun helpers; typecheckCommand also returns `mvn compile` / `./gradlew classes` so --run covers the JVM, with a test), README.md (table keeps every item and adds Maven/Gradle test, JVM linters, compile and Java/Kotlin compiler-checked; combined Go/Rust + Java/Kotlin roadmap box ticked) and CHANGELOG.md (one [Unreleased]). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap item (part 2 of 2): Java/Kotlin support, basic detection of the build tool, tests and linters. Part 1, the deeper Go/Rust checks, is in #13.
What
src/context.ts):javaandkotlin. A language is detected when there is a rootpom.xml/build.gradle(.kts)/settings.gradle(.kts)plus.java/.ktfiles, or when the JVM code is a significant share of the repo.android/build.gradledoesn't turn a JS repo into a Java project.feedback.test: test files undersrc/test/(andandroidTest,integrationTest, …) or named*Test/*Tests/*IT/*Spec. The command is./mvnw test,mvn test,./gradlew testorgradle test(the wrapper is preferred, and Gradle wins when both builds exist). Tests without a root build score 0.5; no tests score 0.feedback.lint: checkstyle, spotless, PMD, SpotBugs, Error Prone, ktlint, detekt, ktfmt, google/palantir-java-format or diktat in any build file, or their config files → 1.0. Otherwise 0.6 for compiler warnings only, the same as Go'sgo vet.feedback.typecheck:mvn compile/gradle classes→ 1.0.types.static: Java/Kotlin are compiler-checked. The title is now "Compiler-checked types (Go/Rust/Java/Kotlin)"; the id is unchanged.--fixgenerates./mvnw package -DskipTests/./gradlew build -x test, the test command, andspotless:check/spotlessCheckwhen spotless is configured.context.commandsnow recognizesmvnwandpackage/assemblebuild commands.nav.gitignoresuggeststarget/(Maven, and Cargo) when that directory exists, is untracked and isn't ignored.Tests
test/jvm.test.ts(5 tests) covers:./mvnw test, lint, compile, static typesgradle classesandroid/folder is not detected as Java./mvnwtarget/is flaggednpm run check && npm run buildpass (88 tests). Self-score is still 100/100.Scores (before → after)
Java repos used to be scored on CI alone: feedback was 100 because only
feedback.ciapplied, and type safety was n/a. They are now judged on real signals../gradlew test, spotless/checkstyleEvery JVM repo rises, because type safety goes from n/a to 100 the same way Go and Rust already work. A JVM repo without tests or linters would fall instead (see the Kotlin test).
🤖 Generated with Claude Code