All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Regression from 0.24.1 and 0.24.0 where sorting inline tables would throw a ValueError if the key in the table had trailing spaces. Resolves #76
- Re-add .pre-commit-hooks. Resolves #75
- Only write to disk if file contents changed
- Dropped support for Python 3.7 and 3.8.
- Dropped support for tomlkit < 0.13.2
- Removed sphinx documentation.
- Error where the
first
override introduced tomlkit wrappers into the configuration and caused serialization problems for the dataclass: #58
- Ability to override sort configuration per key in configuration: #52
- Option to sort particular keys first in output: #53, updated by #54
- Issue where files that contain only comments are doubled: #51
- Trailing whitespace is no longer added to blank comments
- An issue where dotted keys raised a
TypeError
- Turns out that, at this time,
toml-sort
is only compatible withtomlkit
0.11.2
+. We now make this clear in our dependencies. See: #41 and https://github.com/sdispater/tomlkit/compare/0.11.1...0.11.2.
- New pre-commit hook (
toml-sort-fix
) that enables users to change, instead of check, their toml files.
- Issue where an IndexError exception was raised on an empty array. See: #36
Release entirely related to this PR: #33
- Optionally add the ability to sort inline tables and arrays. New switches added for this functionality:
--sort-inline-tables
and--sort-inline-arrays
, which are implied by the existing--all
option - New options groups to the CLI, to group the related formatting, comment, and sorting arguments
- Switch to add trailing comma to multi-line inline arrays
--trailing-comma-inline-array
- Some additional formatting checks
- Make sure inline arrays and tables are consistently formatted
- Normalize the formatting for
key = value
pairs, always one space on either side of equals sign
This is a pretty big comment-related release. Resolves the long-standing issue: #11.
- Header, Footer, and Block comments are retained by default and can be disabled with new CLI options.
- New CLI comment-removal options:
--no-comments
,--no-header-comments
,--no-footer-comments
,--no-inline-comments
,--no-block-comments
- The ability to configure spaces before inline comments with
--spaces-before-inline-comment
- The CLI option:
--no-header
. This will be removed in a future release and is replaced by--no-header-comments
- Preserve inline comments for boolean values. See: #27
- Support configuring CLI with
pyproject.toml
configuration file.
- Moved CLI from click to
argparse
. - Update minimum version of
tomlkit
to 0.8.0. This drops support for Python 3.6.
- CLI option to ignore case while sorting
Note: in this release, we've discovered a strange bug (we believe in tomlkit
) where, sometimes, AOT elements are ordered without our consent. One of the CLI tests has been marked xfail
. If you'd like to help figure out why, we're always looking for contributors!
- Support for multiple FILENAME arguments in the CLI. Used for
precommit
/ linting multiple files. Thanks @atugushev! - Pre-commit hook
- Provide more-comprehensive error messages for interactive CLI usage.
- This
CHANGELOG.md
tomlkit>=0.5.8
. Upstream library made some important fixes.- Add
isort
, make part of pre-commit pipeline.
mypy
,pylint
,black
, andisort
all pass.
- AOT workaround in AOT parser. Latest version of
tomlkit
no longer spits out duplicate elements for AOT.