Skip to main content

Crate ktrs_cli

Crate ktrs_cli 

Source
Expand description

Command-line front ends.

  • ktfmt — a drop-in for ktfmt’s CLI: same flags, messages, exit codes and stdin/stdout.
  • ktlint — a drop-in for ktlint’s CLI (2.0.0-ALPHA-4): same flags, reporters, messages and exit codes.
  • ktrs — the native command (ktrs fmt, ktrs lint), a thin layer over the same engines, and ktrs serve for build tools.

Modules§

ktfmt
Port of ktfmt’s cli package (v0.64): the ktfmt binary’s flags, messages and exit codes.
ktlint
Port of the ktlint 2.0.0-ALPHA-4 CLI (ktlint-cli): the ktlint binary’s flags, messages, reporters and exit codes, over ktrs-lint’s engine and standard rules. Differential test: tools/ktlint-oracle/cli-diff.sh.
ktrs
The native ktrs command. ktrs fmt maps its flags onto ktfmt’s ParsedArgs and runs the same Main, so output, messages and exit codes stay those of the ktfmt drop-in; ktrs lint does the same over the ktlint drop-in (crate::ktrs_lint).
ktrs_lint
ktrs lint: maps its flags onto the ktlint drop-in’s options and runs the same command, so output, reporters and exit codes are ktlint’s. Paths are shown relative to the working directory.
serve
ktrs serve: a long-lived formatter for build tools (the Java shim in java/), so a build pays for process startup once instead of once per file.