Skip to main content

Module ktfmt

Module ktfmt 

Source
Expand description

Port of ktfmt’s cli package (v0.64): the ktfmt binary’s flags, messages and exit codes.

Re-exports§

pub use main::Main;
pub use main::expand_args_to_file_names;
pub use parsed_args::HELP_TEXT;
pub use parsed_args::KTFMT_VERSION;
pub use parsed_args::ParseResult;
pub use parsed_args::ParsedArgs;
pub use parsed_args::parse_options;
pub use parsed_args::process_args;

Modules§

editor_config_resolver
Port of ktfmt’s cli/EditorConfigResolver.kt (v0.64). ec4rs finds and cascades the files; the value parsing here follows ec4j’s property types (getValue(type, default, warn): a missing or invalid value yields the default, a valid one its parsed value, which may be null).
main
Port of ktfmt’s cli/Main.kt (v0.64): formats files in place (in parallel) or stdin to stdout. Messages, exit codes and write decisions match ktfmt’s (tools/ktfmt-oracle/cli-diff.sh). Deviation: each file’s messages are printed in file order, not in completion order.
parsed_args
Port of ktfmt’s cli/ParsedArgs.kt (v0.64).

Functions§

main
The ktfmt binary: args without the program name; returns the exit code.