An unpretentious formatter for TOML files written in Python.
See also the online documentation.
To modify the default options for the package, add a [tool.toml-formatter]
section in your project's pyproject.toml
file. Alternatively, you can pass the --config-file-path
option to select a different config file. Please take a look at the online documentation for more information about the supported configuration options.
To see the configs in use, please run
toml-formatter configs
Upon succesfull installation, you should be able to run
toml-formatter [opts] SUBCOMMAND [subcommand_opts]
where [opts]
and [subcommand_opts]
denote optional command line arguments
that apply, respectively, to toml-formatter
in general and to SUBCOMMAND
specifically.
Please run toml-formatter -h
for information about the supported subcommands
and general toml-formatter
options. For info about specific subcommands and the
options that apply to them only, please run toml-formatter SUBCOMMAND -h
(note
that the -h
goes after the subcommand in this case).
toml-formatter check path/to/toml/files/or/directory/containing/them
toml-formatter check --fix-inplace path/to/toml/files/or/directory/containing/them
from toml_formatter.formatter import FormattedToml
See the API documentation for information about the FormattedToml
class and how to configure the formatter options it uses.