TOML
The TOML language configuration. It is used to define the settings and options for the TOML formatter.
tool
The tool to use for formatting the TOML files. Currently, only taplo is supported.
- Type:
"taplo" - Default:
"taplo"
Example:
[formatter]
tool = "taplo"indent_style
The style of indentation. It can be set to tab or space to use hard tabs or soft tabs respectively.
- Type:
"space" | "tab" - Default:
"tab"
Example:
[formatter.toml]
indent_style = "space"indent_width
The number of columns used for each indentation level.
- Type:
int - Default:
2
Example:
[formatter.toml]
indent_width = 4end_of_line
The character used to represent the end of a line. It can be set to lf or crlf to use line feed ("\n") or carriage return line feed ("\r\n") respectively.
- Type:
"lf" | "crlf" - Default:
"lf"
Example:
[formatter.toml]
end_of_line = "crlf"trim_trailing_whitespace
Flag if any whitespace characters preceding newline characters should be removed.
- Type:
boolean - Default:
true
Example:
[formatter.toml]
trim_trailing_whitespace = falseinsert_final_newline
Flags if a newline character should be inserted at the end of the file.
- Type:
boolean - Default:
true
Example:
[formatter.toml]
insert_final_newline = falseline_width
The maximum number of columns used before wrapping lines.
- Type:
int - Default:
80
Example:
[formatter.toml]
line_width = 120taplo
The configuration options for the taplo formatter.
align_entries
Align entries vertically. Entries that have table headers, comments, or blank lines between them are not aligned.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
align_entries = truealign_comments
Align consecutive comments after entries and items vertically. This applies to comments that are after entries or array items.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
align_comments = falsealign_single_comments
If align_comments is true, apply the alignment in cases where there's only one comment.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
align_single_comments = falsearray_trailing_comma
Put trailing commas for multiline arrays.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
array_trailing_comma = falsearray_auto_expand
Automatically expand arrays to multiple lines if they're too long.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
array_auto_expand = falseinline_table_expand
Expand values (e.g.) inside inline tables where possible.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
inline_table_expand = falsearray_auto_collapse
Automatically collapse arrays if they fit in one line. The array won't be collapsed if it contains a comment.
- Type:
boolean - Default:
true
Example:
[formatter.toml.taplo]
array_auto_collapse = falsecompact_arrays
Omit whitespace padding inside single-line arrays.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
compact_arrays = truecompact_inline_tables
Omit whitespace padding inside inline tables.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
compact_inline_tables = truecompact_entries
Omit whitespace around =.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
compact_entries = trueindent_tables
Indent subtables if they come in order.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
indent_tables = trueindent_entries
Indent entries under tables.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
indent_entries = truereorder_keys
Alphabetically reorder keys that are not separated by blank lines.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
reorder_keys = truereorder_arrays
Alphabetically reorder array values that are not separated by blank lines.
- Type:
boolean - Default:
false
Example:
[formatter.toml.taplo]
reorder_arrays = trueallowed_blank_lines
The maximum amount of consecutive blank lines allowed.
- Type:
int - Default:
2
Example:
[formatter.toml.taplo]
allowed_blank_lines = 1