Seamless Proxy CLI for black ("The uncompromising code formatter") with support for non-pyproject.toml config files
Project description
black-configparser
Seamless proxy CLI for black ("The uncompromising code formatter")
with support for non-pyproject.toml
config files.
Table of Contents
About the Project
The black-configparser
ia yet another tool (next to brunette,
white, and maybe a few more out there),
which tries to fill the gap of missing setup.cfg
(or just any other non-pyproject.toml
) config file.
Why it is different?
Unlike other tools, tries to stay dumb simple and add only minimum needed overhead to black
usage.
- It is seamless - it works on the same CLI command -
black
- just passing logic through some extra code! - There is no complex argument processing, if config file is present, the values set there are passed directly to
black
. - Code of this tool is independent from
black
insides and will work properly as long asblack
won't make any braking changes in its command line options.
Installation
pip install black-configparser
Usage
- Supported configuration files:
setup.cfg
,tox.ini
. - Configuration file section:
[black]
or[tools:black]
.
Important! :warning:
When you
black-configparser
finds black configuration in file, most command line arguments won't be available anymore, except:--check
,--code
,--diff
,--help
,--verbose
&--version
.
Example configuration
[black]
line-length = 120
target-version =
py27
py33
py34
py35
py36
py37
py38
pyi = True
skip-string-normalization = True
color = True
include = \.pyi?$
exclude = /(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist)/]
force-exclude = lorem ipsum
quiet = True
verbose = True
- Almost any option available for black (
black --help
) can be put onto config file. - Values for multi-value arguments must be one per line (separated by
\n
char). - Flags (arguments without values) must be set in config file as
= True
.
Known issues
- Undefined behavior, when one of allowed CLI arguments will be also put inside config file.
- After
black-configparser
package is uninstalled, theblack
command does not work anymore and black package must be reinstalled.
License
MIT
Project details
Release history Release notifications | RSS feed
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 black-configparser-0.1.0b2.tar.gz
.
File metadata
- Download URL: black-configparser-0.1.0b2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a04c85efabe00a4525bd8cbff21aca2c3c60bf6721239c98820b3d0f137092f |
|
MD5 | 27a9139ee5ed7aa205f6db645e971a58 |
|
BLAKE2b-256 | 136f1cb8adb5abd61b428aae1a8932ae6c067980d1daf7336fea68132236bf8f |
Provenance
File details
Details for the file black_configparser-0.1.0b2-py3-none-any.whl
.
File metadata
- Download URL: black_configparser-0.1.0b2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97444f5890b88efbdcd4465ef6b94ea027fa4150da7e908a847477fb2110ed46 |
|
MD5 | 017c7a5771b9900fa5e9ada3e67519c0 |
|
BLAKE2b-256 | 37470157b71f0e715f1c220ee38e08596d7e6c19177de68b2020aea6a6575135 |