Skip to content

An unpretentious formatter for TOML files written in Python.

License

Notifications You must be signed in to change notification settings

destination-earth-digital-twins/toml-formatter

 
 

Repository files navigation

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.

About

An unpretentious formatter for TOML files written in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%