Configuration¶
Configuration via file¶
The [tox-toml-fmt] table is used when present in the tox.toml file:
[tox-toml-fmt]
# After how many columns split arrays/dicts into multiple lines and wrap long strings;
# use a trailing comma in arrays to force multiline format instead of lowering this value
column_width = 120
# Number of spaces for indentation
indent = 2
# Extra newlines between sub-tables in the same group (e.g. "\n" for one blank line between sub-tables)
sub_table_spacing = ""
# Extra newlines between root table groups (e.g. "\n" for one blank line, "\n\n" for two)
separate_root_table = "\n"
# Environments pinned to the start of env_list
pin_envs = ["fix", "type"]
If not set they will default to values from the CLI. The example above shows the defaults (except pin_envs
which defaults to an empty list).
Command line interface¶
tox-toml-fmt [-h] [-V] [-s | --check] [-n] [--config path] [--column-width count]
[--indent count] [--table-format {short,long}]
[--sub-table-spacing SUB_TABLE_SPACING]
[--separate-root-table SEPARATE_ROOT_TABLE] [--expand-tables EXPAND_TABLES]
[--collapse-tables COLLAPSE_TABLES] [--skip-wrap-for-keys SKIP_WRAP_FOR_KEYS]
[--pin-env PIN_ENVS]
inputs [inputs ...]
tox-toml-fmt positional arguments¶
inputs- pyproject.toml file(s) to format, use'-'to read from stdin
tox-toml-fmt options¶
tox-toml-fmt run mode¶
-s,--stdout- print the formatted TOML to the stdout, implied if reading from stdin--check- check and fail if any input would be formatted, printing any diffs-n,--no-print-diff- Flag indicating to print diff for the check mode
tox-toml-fmt formatting behavior¶
--column-widthCOUNT- max column width in the TOML file (default:120)--indentCOUNT- number of spaces to use for indentation (default:2)--table-formatTABLE_FORMAT- table format:'short'collapses sub-tables,'long'expands to [table.subtable] (default:short)--sub-table-spacingSUB_TABLE_SPACING- extra newlines between sub-tables in the same group (e.g.' for compact, 'n’ for one blank line) (default:)--separate-root-tableSEPARATE_ROOT_TABLE- extra newlines between root table groups (e.g.'\n'for one blank line,'\n\n'for two) (default:)--expand-tablesEXPAND_TABLES- comma-separated list of tables to force expand (default:[])--collapse-tablesCOLLAPSE_TABLES- comma-separated list of tables to force collapse (default:[])--skip-wrap-for-keysSKIP_WRAP_FOR_KEYS- comma-separated list of key patterns to skip string wrapping (supports wildcards like'*.parse') (default:[])--pin-envPIN_ENVS- environments pinned to the start of env_list (comma separated) (default:[])