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, or 1.8.0 with --ktlint-version=1.8): 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 (ktfmt and ktlint requests).

Modules§

java_launcher
The Windows java launcher’s wildcard expansion of application arguments, which ktfmt and ktlint get before their main runs: an argument with an unquoted * or ? becomes the matching entries of its parent directory. Ports JDK 21 cmdtoargs.c (next_arg, JLI_CmdToArgs), java_md.c (CreateApplicationArgs) and LauncherHelper.expandArgs. Other platforms pass arguments through (the shell expands there).
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. With --ktlint-version=1.8 (or ktrs_ktlint_version = 1.8) it is the 1.8.0 CLI instead: version.
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 ktlint is that drop-in itself.
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.