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, andktrs servefor build tools (ktfmt and ktlint requests),ktrs lsp(crates/ktrs-lsp) for editors, andktrs migrate(crates/ktrs-project’smigrate) for switching builds to the drop-ins.
Modules§
- java_
launcher - The Windows
javalauncher’s wildcard expansion of application arguments, which ktfmt and ktlint get before theirmainruns: an argument with an unquoted*or?becomes the matching entries of its parent directory. Ports JDK 21cmdtoargs.c(next_arg,JLI_CmdToArgs),java_md.c(CreateApplicationArgs) andLauncherHelper.expandArgs. Other platforms pass arguments through (the shell expands there). - ktfmt
- Port of ktfmt’s
clipackage (v0.64): thektfmtbinary’s flags, messages and exit codes. - ktlint
- Port of the ktlint 2.0.0-ALPHA-4 CLI (
ktlint-cli): thektlintbinary’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(orktrs_ktlint_version = 1.8) it is the 1.8.0 CLI instead:version. - ktrs
- The native
ktrscommand.ktrs fmtmaps its flags onto ktfmt’sParsedArgsand runs the sameMain, so output, messages and exit codes stay those of thektfmtdrop-in;ktrs lintdoes the same over thektlintdrop-in (crate::ktrs_lint);ktrs ktlintis that drop-in itself. - ktrs_
lint ktrs lint: maps its flags onto thektlintdrop-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.- migrate
ktrs migrate: the build-file rewrite planned byktrs_project::migrate, shown as a diff or written.- serve
ktrs serve: a long-lived formatter for build tools (the Java shim injava/), so a build pays for process startup once instead of once per file.