Type object
Schema URL https://catalog.lintel.tools/schemas/schemastore/pyproject/_shared/latest--partial-black.json
Parent schema pyproject
Type: object

Properties

code string

Format the code passed in as a string.

line-length integer

How many characters per line to allow.

Default: 88
target-version enum[]

Python versions that should be supported by Black's output. You should include all versions that your code supports. By default, Black will infer target versions from the project metadata in pyproject.toml. If this does not yield conclusive results, Black will use per-file auto-detection.

pyi boolean

Format all input files like typing stubs regardless of file extension. This is useful when piping source on standard input.

Default: false
ipynb boolean

Format all input files like Jupyter Notebooks regardless of file extension. This is useful when piping source on standard input.

Default: false
python-cell-magics string[]

When processing Jupyter Notebooks, add the given magic to the list of known python-magics (capture, prun, pypy, python, python3, time, timeit). Useful for formatting cells with custom python magics.

skip-source-first-line boolean

Skip the first line of the source code.

Default: false
skip-string-normalization boolean

Don't normalize string quotes or prefixes.

Default: false
skip-magic-trailing-comma boolean

Don't use trailing commas as a reason to split lines.

Default: false
preview boolean

Enable potentially disruptive style changes that may be added to Black's main functionality in the next major release.

Default: false
unstable boolean

Enable potentially disruptive style changes that have known bugs or are not currently expected to make it into the stable style Black's next major release. Implies --preview.

Default: false
enable-unstable-feature string[]

Enable specific features included in the --unstable style. Requires --preview. No compatibility guarantees are provided on the behavior or existence of any unstable features.

check boolean

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.

Default: false
diff boolean

Don't write the files back, just output a diff to indicate what changes Black would've made. They are printed to stdout so capturing them is simple.

Default: false
color boolean

Show (or do not show) colored diff. Only applies when --diff is given.

Default: false
fast boolean

By default, Black performs an AST safety check after formatting your code. The --fast flag turns off this check and the --safe flag explicitly enables it. [default: --safe]

Default: false
required-version string

Require a specific version of Black to be running. This is useful for ensuring that all contributors to your project are using the same version, because different versions of Black may format code a little differently. This option can be set in a configuration file for consistent results across environments.

exclude string

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). By default, Black also ignores all paths listed in .gitignore. Changing this value will override all default exclusions. [default: /(.direnv|.eggs|.git|.hg|.ipynb_checkpoints|.mypy_cache|.nox|.pytest_cache|.ruff_cache|.tox|.svn|.venv|.vscode|pypackages|_build|buck-out|build|dist|venv)/]

extend-exclude string

Like --exclude, but adds additional files and directories on top of the default values instead of overriding them.

force-exclude string

Like --exclude, but files and directories matching this regex will be excluded even when they are passed explicitly as arguments. This is useful when invoking Black programmatically on changed files, such as in a pre-commit hook or editor plugin.

include string

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). Overrides all exclusions, including from .gitignore and command line options.

Default: "(\.pyi?|\.ipynb)$"
workers integer

When Black formats multiple files, it may use a process pool to speed up formatting. This option controls the number of parallel workers. This can also be specified via the BLACK_NUM_WORKERS environment variable. Defaults to the number of CPUs in the system.

quiet boolean

Stop emitting all non-critical output. Error messages will still be emitted (which can silenced by 2>/dev/null).

Default: false
verbose boolean

Emit messages about files that were not changed or were ignored due to exclusion patterns. If Black is using a configuration file, a message detailing which one it is using will be emitted.

Default: false