Skip to main content

Module config

Module config 

Source
Expand description

Runtime formatter configuration and config-file loading. Runtime formatter configuration.

Config is the fully resolved in-memory configuration used by the formatter. It is built from defaults, user config files (.cmakefmt.yaml, .cmakefmt.yml, or .cmakefmt.toml), and CLI overrides.

Re-exports§

pub use file::default_config_template;
pub use file::default_config_template_for;
pub use file::generate_json_schema;
pub use file::render_effective_config;
pub use file::DumpConfigFormat;

Modules§

file
Config-file loading and starter template generation.

Structs§

CommandConfig
A resolved config for formatting a specific command, with per-command overrides already applied.
Config
Full formatter configuration.
Experimental
Experimental formatting options gated behind --preview or the [experimental] config section. All options default to false.
PerCommandConfig
Per-command overrides. All fields are optional — only specified fields override the global config for that command.

Enums§

CaseStyle
How to normalise command/keyword casing.
DangleAlign
How to align the dangling closing paren.
FractionalTabPolicy
How to handle fractional tab indentation when Config::use_tabchars is true.
LineEnding
Output line-ending style.

Functions§

convert_legacy_config_files
Convert one or more legacy cmake-format config files into cmakefmt config text in the requested output format.