Skip to main content

run_formatters

Run the black formatter on the specified files.

def run_formatters(
written_files: list[str],
black_path: str = object(),
stderr: file-like object = sys.stderr
) - > null

Run the black formatter on the specified files.

Parameters

NameTypeDescription
written_fileslist[str]A list of file paths that should be processed by the black formatter.
black_pathstr = object()The file path to the black executable; if not provided, the function attempts to locate it using system PATH.
stderrfile-like object = sys.stderrThe stream where error messages and stack traces are written if the formatter fails to launch.

Returns

TypeDescription
nullNothing is returned; the function performs in-place formatting of the specified files via a subprocess.