An opinionated tool for formatting your pyproject.toml
files. Built in Rust and based on
taplo.
Should you use this?
Generally, using taplo would probably be more suitable for the typical
workflow. The primary purpose of this Python package is to facilitate easy integration with Python-based CI/CD pipelines
solely for formatting pyproject.toml
files.
Sortie is available as sortie on PyPI:
pip install sortie
To use sortie you can try the following:
sortie # formats pyproject file
sortie --check # checks if pyproject file needs to be formatted
To use Sortie (v0.1.0) via pre-commit, add the following to your .pre-commit-config.yaml
:
- repo: https://github.com/8bit-pixies/sortie-pre-commit
rev: v0.1.0
hooks:
- id: sortie
You can modify the behavior of the formatter by setting the configuration in your pyproject.toml
file. Sortie utilizes the [tool.sortie]
section of your file. For full options, refer to
formatter options.
Here is an example pyproject.toml
file:
[tool.sortie]
reorder_arrays = true
reorder_keys = true