Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 2.98 KB

README.md

File metadata and controls

53 lines (41 loc) · 2.98 KB

GitHub Github Pages

Contributors Welcome Linting Tests codecov

TOML Formatter

An unpretentious formatter for TOML files written in Python.

See also the online documentation.

Configuration

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

Basic Usage

CLI Usage

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).

Check if file(s) are formatted

toml-formatter check path/to/toml/files/or/directory/containing/them

Fix the formatting

toml-formatter check --fix-inplace path/to/toml/files/or/directory/containing/them

Use as Module

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.