blacken_docs ¤
Callable for blacken-docs.
Functions:
-
run
–Run
blacken-docs
.
run ¤
run(
*paths: str | Path,
exts: Sequence[str] | None = None,
exclude: Sequence[str | Pattern] | None = None,
skip_errors: bool = False,
rst_literal_blocks: bool = False,
line_length: int | None = None,
string_normalization: bool = True,
is_pyi: bool = False,
is_ipynb: bool = False,
skip_source_first_line: bool = False,
magic_trailing_comma: bool = True,
python_cell_magics: set[str] | None = None,
preview: bool = False,
check_only: bool = False
) -> int
Run blacken-docs
.
Parameters:
-
*paths
(str | Path
, default:()
) –Directories and files to format.
-
exts
(Sequence[str] | None
, default:None
) –List of extensions to select files with.
-
exclude
(Sequence[str | Pattern] | None
, default:None
) –List of regular expressions to exclude files.
-
skip_errors
(bool
, default:False
) –Don't exit non-zero for errors from Black (normally syntax errors).
-
rst_literal_blocks
(bool
, default:False
) –Also format literal blocks in reStructuredText files (more below).
-
line_length
(int | None
, default:None
) –How many characters per line to allow.
-
string_normalization
(bool
, default:True
) –Normalize string quotes or prefixes.
-
is_pyi
(bool
, default:False
) –Format all input files like typing stubs regardless of file extension.
-
is_ipynb
(bool
, default:False
) –Format all input files like Jupyter Notebooks regardless of file extension.
-
skip_source_first_line
(bool
, default:False
) –Skip the first line of the source code.
-
magic_trailing_comma
(bool
, default:True
) –Use trailing commas as a reason to split lines.
-
python_cell_magics
(set[str] | None
, default:None
) –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.
-
preview
(bool
, default:False
) –Enable potentially disruptive style changes that may be added to Black's main functionality in the next major release.
-
check_only
(bool
, default:False
) –Don't modify files but indicate when changes are necessary with a message and non-zero return code.
Returns:
-
int
–Success/failure.
Source code in src/duty/callables/blacken_docs.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|