ktlint
$ ktlint Community Low RiskZero-configuration Kotlin linter and formatter enforcing official Kotlin coding conventions and .editorconfig settings. Supports --reporter=json (plus SARIF/Checkstyle) for structured agent parsing and -F (--format) for auto-formatting.
brew install ktlint Lints and formats local Kotlin .kt/.kts files offline; no MCP server adds value.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --reporter=json, --reporter=sarif, --relative, and --log-level=error, though lacks a --dry-run diff preview.
--reporter=jsonoutputs structured JSON findings
Read-only by default; mutates files only when -F / --format is passed.
- Non-destructive default lint run; explicit
-Fopt-in
Easy via Homebrew or release JAR/script, but requires a JVM runtime and incurs JVM startup latency.
- JVM dependency and cold startup overhead
Standard Kotlin style linter/formatter, though slower than native binaries and often wrapped in Gradle.
- Enforces official Kotlin style guide +
.editorconfig
Established community standard (pinterest/ktlint) under MIT license.
- Maintained at
pinterest/ktlint
Clear CLI installation, .editorconfig, and rule reference at ktlint.github.io.
- Official docs at ktlint.github.io
Security, Auth & Guardrails
Offline local Kotlin linter/formatter; no credentials stored or required.
MIT open-source Kotlin/JVM CLI; completely free.
# ktlint Agent Rules - Always run `ktlint --reporter=json` read-only before running `ktlint -F`. - Quote glob arguments (e.g. `"src/**/*.kt"`) so ktlint performs recursive matching across platforms.
Agent-Ready Command Recipes
Safe Read-Only Queries
ktlint --reporter=json "src/**/*.kt"
Emits JSON violation arrays per file with line, column, message, and rule ID without modifying files.
Controlled Writes & Previews
ktlint -F "src/**/*.kt"
Auto-formats fixable Kotlin style violations in place.
Strengths for Agents
- + Zero-config defaults plus native
--reporter=jsonand--reporter=sarif. - + Respects
.editorconfigand enforces standard Kotlin conventions consistently.
Caveats & Pitfalls
- ! Requires Java/JVM runtime with noticeable startup latency on small single-file runs.
- ! Unquoted
**/*.ktglobs can expand unexpectedly in shells instead of using ktlint's internal globbing.