ktrs

Kotlin formatter and linter in Rust, without a JVM

Image 1 of 1: ktrs playground with Kotlin input and formatted output

A native replacement for ktfmt and ktlint that produces the same output and ships as small binaries with no runtime. A browser playground runs the formatter as WebAssembly.

  • 73 ms vs 1.74 sFormat okhttp

Trade-offs

  • Warming up the JVM closes most of ktfmt's gap but little of ktlint's, so the speedup depends on the tool.

Q&A1

1.6 MB for ktfmt and 4.3 MB for ktlint, against 56.5 MB for ktfmt's native image.

Reviews

Loading reviews

    More in Linters & formatters

    See all 19 →
    • MigrationPilotPostgreSQL migration linter that blocks unsafe DDL before merge
    • polyOne Rust binary that lints and formats about 30 languages
    • augurPolicy-based linter for OpenTelemetry Collector configurations
    • alintLinter for repository structure, files and config values
    • jev-specCLI that fails the build when code drifts from its Markdown spec
    • codehoundPython static analyzer for async and correctness bugs that pass review

    More in Kotlin

    See all 30 →
    • TellyscopeAndroid TV debloater and remote that runs from a phone over ADB
    • OffPayOffline UPI payments over *99# USSD, with no data connection
    • KotauthMulti-tenant OAuth2 and OIDC identity server in Kotlin, self-hosted in Docker
    • TesseraDebian and Flathub apps on Android, each in its own window on the phone's GPU
    • KetchDownload manager across desktop, mobile, web and the command line
    • MockNest ServerlessWireMock-compatible API mocking in an AWS account

    More in CLI tools

    See all 74 →
    • ZeroboxDeny-by-default process sandbox with per-host secret injection
    • blitcpFile copier that reads in disk order, dedupes and streams over raw SSH
    • jc-rsjc rewritten as one static binary that turns command output into JSON
    • pistachioDeclarative PostgreSQL schema management with a plan and apply workflow
    • quiverDump, load, copy and stream MySQL, MariaDB and TiDB from one consistent snapshot
    • haxMinimalist terminal coding agent written in C