Skip to content

Basic Java/Kotlin support: detection, tests, linters, build commands - #14

Merged
ranjan-mohanty merged 2 commits into
mainfrom
roadmap/jvm
Nov 15, 2026
Merged

ranjan-mohanty merged 2 commits into
mainfrom
roadmap/jvm

Conversation

@ranjan-mohanty

Copy link
Copy Markdown
Collaborator

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

  • Detection (src/context.ts):
    • New languages java and kotlin. A language is detected when there is a root pom.xml / build.gradle(.kts) / settings.gradle(.kts) plus .java/.kt files, or when the JVM code is a significant share of the repo.
    • A React Native app's android/build.gradle doesn't turn a JS repo into a Java project.
    • JVM files were previously counted as "other" code. They now count as their own language, so per-language weighting covers them.
  • Existing checks score the JVM side. No new check ids, no weight changes.
    • feedback.test: test files under src/test/ (and androidTest, integrationTest, …) or named *Test/*Tests/*IT/*Spec. The command is ./mvnw test, mvn test, ./gradlew test or gradle 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's go 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.
  • --fix generates ./mvnw package -DskipTests / ./gradlew build -x test, the test command, and spotless:check/spotlessCheck when spotless is configured. context.commands now recognizes mvnw and package/assemble build commands.
  • nav.gitignore suggests target/ (Maven, and Cargo) when that directory exists, is untracked and isn't ignored.

Tests

test/jvm.test.ts (5 tests) covers:

  • a Maven repo with checkstyle: detection, ./mvnw test, lint, compile, static types
  • a Kotlin/Gradle repo without tests or a linter: test 0, lint 0.6, gradle classes
  • a JS app with a small android/ folder is not detected as Java
  • generated docs and command detection for ./mvnw
  • an untracked target/ is flagged

npm run check && npm run build pass (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.ci applied, and type safety was n/a. They are now judged on real signals.

repo before → after notes
google/gson (Maven, multi-module) 61 → 67 143 test files, checkstyle/Error Prone, types n/a → 100
spring-projects/spring-petclinic (Maven + Gradle) 63 → 69 ./gradlew test, spotless/checkstyle
JakeWharton/timber (Gradle, Java + Kotlin) 58 → 64
the other 13 comparison repos (JS/TS, Python, Go, Rust) unchanged

Every 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

ranjan-mohanty and others added 2 commits November 15, 2026 00:28
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>
@ranjan-mohanty
ranjan-mohanty merged commit 264141b into main Nov 15, 2026
9 checks passed
@ranjan-mohanty
ranjan-mohanty deleted the roadmap/jvm branch November 15, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant