pub struct FormatterDefinition {
pub preset: Option<String>,
pub cmd: Option<String>,
pub args: Option<Vec<String>>,
pub prepend_args: Option<Vec<String>>,
pub append_args: Option<Vec<String>>,
pub stdin: Option<bool>,
pub enabled: Option<bool>,
}Expand description
NEW: Named formatter definition (formatters.NAME sections in new format) OLD: Language-specific formatter config (formatters.LANG sections in old format)
In new format, if the definition name matches a built-in preset, unspecified fields will inherit from that preset. This allows partial overrides like:
[formatters.air]
args = ["format", "--custom"] # Overrides args, inherits cmd/stdin from built-in "air"Additionally, you can modify arguments incrementally using prepend-args and append-args:
[formatters.air]
append-args = ["-i", "2"] # Adds args to end: ["format", "{}", "-i", "2"]Fields§
§preset: Option<String>Reference to a built-in preset (e.g., “air”, “black”) - OLD FORMAT ONLY In new format, presets are referenced directly in [formatters] mapping
cmd: Option<String>Custom command to execute (None = inherit from preset if name matches)
args: Option<Vec<String>>Arguments to pass (None = inherit from preset if name matches)
prepend_args: Option<Vec<String>>Arguments to prepend to base args (from preset or explicit args)
append_args: Option<Vec<String>>Arguments to append to base args (from preset or explicit args)
stdin: Option<bool>Whether the formatter reads from stdin (None = inherit from preset if name matches)
enabled: Option<bool>DEPRECATED: Whether formatter is enabled (old format only)
Trait Implementations§
Source§impl Clone for FormatterDefinition
impl Clone for FormatterDefinition
Source§fn clone(&self) -> FormatterDefinition
fn clone(&self) -> FormatterDefinition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more