| 1 |
:Version: 21.4b2 |
| 2 |
:Date: 2021-10-10 |
| 3 |
:Copyright: 2018 Ćukasz Langa |
| 4 |
:Title: black |
| 5 |
:Subtitle: uncompromising Python code formatter |
| 6 |
:Manual group: uncompromising Python code formatter |
| 7 |
:Manual section: "1" |
| 8 |
|
| 9 |
Summary |
| 10 |
####### |
| 11 |
|
| 12 |
``black`` is the uncompromising Python code formatter. By using it, |
| 13 |
you agree to cede control over minutiae of hand-formatting. In return, |
| 14 |
Black gives you speed, determinism, and freedom from pycodestyle |
| 15 |
nagging about formatting. You will save time and mental energy for |
| 16 |
more important matters. |
| 17 |
|
| 18 |
Usage |
| 19 |
##### |
| 20 |
|
| 21 |
black [OPTIONS] [SRC]... |
| 22 |
|
| 23 |
Common Options |
| 24 |
############## |
| 25 |
|
| 26 |
Options: |
| 27 |
-c, --code TEXT Format the code passed in as a string. |
| 28 |
-l, --line-length INTEGER How many characters per line to allow. |
| 29 |
[default: 88] |
| 30 |
|
| 31 |
-t, --target-version [py27|py33|py34|py35|py36|py37|py38|py39] |
| 32 |
Python versions that should be supported by |
| 33 |
Black's output. [default: per-file auto- |
| 34 |
detection] |
| 35 |
|
| 36 |
--pyi Format all input files like typing stubs |
| 37 |
regardless of file extension (useful when |
| 38 |
piping source on standard input). |
| 39 |
|
| 40 |
-S, --skip-string-normalization |
| 41 |
Don't normalize string quotes or prefixes. |
| 42 |
-C, --skip-magic-trailing-comma |
| 43 |
Don't use trailing commas as a reason to |
| 44 |
split lines. |
| 45 |
|
| 46 |
--check Don't write the files back, just return the |
| 47 |
status. Return code 0 means nothing would |
| 48 |
change. Return code 1 means some files |
| 49 |
would be reformatted. Return code 123 means |
| 50 |
there was an internal error. |
| 51 |
|
| 52 |
--diff Don't write the files back, just output a |
| 53 |
diff for each file on stdout. |
| 54 |
|
| 55 |
--color / --no-color Show colored diff. Only applies when |
| 56 |
`--diff` is given. |
| 57 |
|
| 58 |
--fast / --safe If --fast given, skip temporary sanity |
| 59 |
checks. [default: --safe] |
| 60 |
|
| 61 |
--include TEXT A regular expression that matches files and |
| 62 |
directories that should be included on |
| 63 |
recursive searches. An empty value means |
| 64 |
all files are included regardless of the |
| 65 |
name. Use forward slashes for directories |
| 66 |
on all platforms (Windows, too). Exclusions |
| 67 |
are calculated first, inclusions later. |
| 68 |
[default: \.pyi?$] |
| 69 |
|
| 70 |
--exclude TEXT A regular expression that matches files and |
| 71 |
directories that should be excluded on |
| 72 |
recursive searches. An empty value means no |
| 73 |
paths are excluded. Use forward slashes for |
| 74 |
directories on all platforms (Windows, too). |
| 75 |
Exclusions are calculated first, inclusions |
| 76 |
later. [default: /(\.git|\.hg|\.mypy_cache| |
| 77 |
\.tox|\.venv|_build|buck-out|build|dist)/] |
| 78 |
|
| 79 |
--extend-exclude TEXT Like --exclude, but adds additional files |
| 80 |
and directories on top of the excluded ones. |
| 81 |
(Useful if you simply want to add to the |
| 82 |
default) |
| 83 |
|
| 84 |
--force-exclude TEXT Like --exclude, but files and directories |
| 85 |
matching this regex will be excluded even |
| 86 |
when they are passed explicitly as |
| 87 |
arguments. |
| 88 |
|
| 89 |
--stdin-filename TEXT The name of the file when passing it through |
| 90 |
stdin. Useful to make sure Black will |
| 91 |
respect --force-exclude option on some |
| 92 |
editors that rely on using stdin. |
| 93 |
|
| 94 |
-q, --quiet Don't emit non-error messages to stderr. |
| 95 |
Errors are still emitted, silence those with |
| 96 |
2>/dev/null. |
| 97 |
|
| 98 |
-v, --verbose Also emit messages to stderr about files |
| 99 |
that were not changed or were ignored due to |
| 100 |
--exclude=. |
| 101 |
|
| 102 |
--version Show the version and exit. |
| 103 |
|
| 104 |
--config FILE Read configuration from PATH. |
| 105 |
|
| 106 |
-h, --help Show this message and exit. |