BLACK(1)
π black β the manual page, but make it a group chat
okay bestie, so this is the manual for black, and the page itself is stamped 21.4b2 π β that's the version, icon behavior. In the actual printed manual the top line reads black() on the left and 21.4b2 on the right, and honestly? iconic formatting. We love a symmetrical header. β¨
πΈ Name
black β the uncompromising Python code formatter. no cap, it says what it says. π«Ά
π Summary
okay so here's the whole vibe: black is the uncompromising Python code formatter. And when you run it, you are literally, genuinely agreeing to cede control over minutiae of hand-formatting. like, you're handing over the aux cord. π§
In return, Black gives you:
- speed β‘
- determinism π―
- freedom from
pycodestylenagging about formatting π€
and the payoff is real: you will save time and mental energy for more important matters. main character energy only. π
π Usage
black [OPTIONS] [SRC]...
β¨ Common Options
girl there are SO many and I love all of them. here we go, one by one, no skips, periodt.
-c,--code TEXTβ format the code passed in as a string. just yeet the code straight in there as text. π-l,--line-length INTEGERβ how many characters per line to allow.[default: 88]β yes bb, 88, the sacred number. π§-t,--target-version [py27|py33|py34|py35|py36|py37|py38|py39]β the Python versions that should be supported by Black's output.[default: per-file auto-detection]β it literally reads the room and figures it out per file. π--pyiβ format all input files like typing stubs regardless of file extension. super useful when piping source on standard input. π₯-S,--skip-string-normalizationβ don't normalize string quotes or prefixes. leave my quotes ALONE. π-C,--skip-magic-trailing-commaβ don't use trailing commas as a reason to split lines. the comma loses its power, rip. π--checkβ don't write the files back, just return the status. and the status codes are a whole language:- return code
0means nothing would change π’ - return code
1means some files would be reformatted π‘ - return code
123means there was an internal error π΄
- return code
--diffβ don't write the files back, just output a diff for each file on stdout. show me the receipts. π§Ύ--color/--no-colorβ show colored diff. only applies when--diffis given. so it's giving β¨aestheticβ¨ diff, but only in diff mode. no solo performances.--fast/--safeβ if--fastis given, skip temporary sanity checks.[default: --safe]β we stay safety-on by default, bestie. π‘οΈ--include TEXTβ a regular expression that matches files and directories that should be included on recursive searches. an empty value means all files are included regardless of the name. use forward slashes for directories on all platforms (Windows, too). exclusions are calculated first, inclusions later.[default: .pyi?$]β slash/.pyi?$/energy, forward slashes everywhere, even Windows, I don't make the rules. π--exclude TEXTβ a regular expression that matches files and directories that should be excluded on recursive searches. an empty value means no paths are excluded. use forward slashes for directories on all platforms (Windows, too). exclusions are calculated first, inclusions later.[default: /(.git|.hg|.mypy_cache|.tox|.venv|_build|buck-out|build|dist)/]β that whole little list of cursed folders gets left out, and honestly? correct. π«--extend-exclude TEXTβ like--exclude, but adds additional files and directories on top of the excluded ones. (useful if you simply want to add to the default) β it's additive, not replacement, iykyk. β--force-exclude TEXTβ like--exclude, but files and directories matching this regex will be excluded even when they are passed explicitly as arguments. like, even if you literally type the path. it will still say no. π--stdin-filename TEXTβ the name of the file when passing it through stdin. useful to make sure Black will respect--force-excludeoption on some editors that rely on using stdin. gotta give it a name so it knows whether to ghost it. π»-q,--quietβ don't emit non-error messages to stderr. errors are still emitted β silence those with2>/dev/null. so if you want TRUE silence you gotta do the redirect yourself, bestie. π€«-v,--verboseβ also emit messages to stderr about files that were not changed or were ignored due to--exclude=. spill the tea about every single file. β--versionβ show the version and exit. quick peek and bounce. π--config FILEβ read configuration from PATH. π-h,--helpβ show this message and exit. the classic. if you're reading this, congrats, you already found it. π
π Copyright
2018 Εukasz Langa
real ones credit the author. this is the copyright line, verbatim, don't touch it. π«Ά
aaaand that's the whole page, bestie. the printed manual's bottom line is dated 2021-10-10, it's page 1, and it signs off as black(), version 21.4b2 β so consider this your cute little sign-off: written by the black crew, dated 2021-10-10, page 1, running on 21.4b2. now go format something gorgeous. πΈπβ¨
π¦ where this page comes from
- ubuntu stonking: black 26.5.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms