An opinionated CLI for asottile/reorder_python_imports
Project description
sorti
An opinionated CLI for asottile/reorder_python_imports.
Installation
pip install sorti
Usage
sorti [-h] [--check] [--version] [source [source ...]]
Examples
Sorting imports in a single file
sorti my/file.py
Checking if any files in a directory need sorting
sorti --check my/directory
Why?
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.
- https://github.com/asottile/reorder_python_imports/issues/45
- https://github.com/asottile/reorder_python_imports/issues/74
- https://github.com/asottile/reorder_python_imports/pull/76
So, 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
made.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sorti-2.0.1.tar.gz
.
File metadata
- Download URL: sorti-2.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78096f944799a4db76d4ca3d883a4ec9c319f40c9a0a523c0c2d975bbb7a0aea |
|
MD5 | c0c08439d1ad992517d8818bc6439c65 |
|
BLAKE2b-256 | 6d89863fc2d5d50ada816ffbe781ccf4a8d9d840ab235961c007049dc7746ceb |
File details
Details for the file sorti-2.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: sorti-2.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55ccd0ab353628f52baf7fe74f6d6fba5ce0a413c548acdb4a3df48334737dbe |
|
MD5 | 1b989c02002a2e589fc8e6d85602697d |
|
BLAKE2b-256 | 5aecce7f73c43bb7ab24cd9763c75507399f3a1d9c50d3af872fa593eecd6b84 |