An opinionated CLI for asottile/reorder_python_imports
An opinionated CLI for asottile/reorder_python_imports.
pip install sorti
sorti [-h] [--check] [--version] [source [source ...]]
Sorting imports in a single file
Checking if any files in a directory need sorting
sorti --check my/directory
This package makes the features of reorder_python_imports fit into my workflow. I think the original project is awesome, but the CLI does not work the way I would like it to.
My opinions diverge from asottile's on these issues.
sorti will support a much narrower use case than the original project.
The command has one flag:
--check, which will make the command output the
files it would change and return an exit code of 1 if there are changes to be
sorti uses source file discovery from python/black and aims to find the
same files, given the same inputs.
I don't intend to support anything else than latest stable Python, for the moment that is 3.7.
The name sorti which means exit in Swedish seemed fitting since the divergence of opinions that lead to its creation was about exit codes, it's also a play on the popular import sorter isort. In Old Norse it means black cloud, which also seems appropriate since it uses parts of black.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for sorti-2.0.1-py2.py3-none-any.whl