black - Man Page
The uncompromising code formatter.
Examples (TL;DR)
- Auto-format a file or entire directory:
black path/to/file_or_directory
- Format the code passed in as a string:
black -c path/to/file_or_directory
- Output a diff for each file on stdout:
black --diff path/to/file_or_directory
- Return the status without writing the files back:
black --check path/to/file_or_directory
- Auto-format a file or directory emitting exclusively error messages to stderr:
black --quiet path/to/file_or_directory
Synopsis
black [Options] [SRC]...
Description
The uncompromising code formatter.
Options
- -l, --line-length INTEGER
How many character per line to allow. [default: 88]
- --check
Don't write the files back, just return the status. Return code 0 means nothing would change. Return code 1 means some files would be reformatted. Return code 123 means there was an internal error.
- --diff
Don't write the files back, just output a diff for each file on stdout.
- --fast / --safe
If --fast given, skip temporary sanity checks. [default: --safe]
- -q, --quiet
Don't emit non-error messages to stderr. Errors are still emitted, silence those with 2>/dev/null.
- --version
Show the version and exit.
Info
04-May-2018 black Manual