Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Black Processor

Purpose

Checks Python file formatting using Black, the uncompromising code formatter. Runs black --check which verifies files are already formatted without modifying them.

How It Works

Python files matching configured extensions are checked via black --check. The command exits with a non-zero status if any file would be reformatted, causing the build to fail.

Source Files

  • Input: **/*{src_extensions} (default: *.py)

Configuration

[processor.black]
src_extensions = [".py"]                      # File extensions to check (default: [".py"])
dep_inputs = []                         # Additional files that trigger rechecks when changed
args = []                                 # Extra arguments passed to black
KeyTypeDefaultDescription
src_extensionsstring[][".py"]File extensions to discover
dep_inputsstring[][]Extra files whose changes trigger rechecks
dep_autostring[]["pyproject.toml"]Config files that auto-trigger rechecks
argsstring[][]Additional arguments passed to black

Batch support

The tool accepts multiple files on the command line. When batching is enabled (default), rsconstruct passes all files in a single invocation for better performance.