File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ def run(
24
24
magic_trailing_comma : bool = True ,
25
25
python_cell_magics : set [str ] | None = None ,
26
26
preview : bool = False ,
27
+ check_only : bool = False ,
27
28
) -> int :
28
29
"""Run `blacken-docs`.
29
30
@@ -44,6 +45,8 @@ def run(
44
45
Useful for formatting cells with custom python magics.
45
46
preview: Enable potentially disruptive style changes that may be added
46
47
to Black's main functionality in the next major release.
48
+ check_only: Don't modify files but indicate when changes are necessary
49
+ with a message and non-zero return code.
47
50
48
51
Returns:
49
52
Success/failure.
@@ -80,5 +83,6 @@ def run(
80
83
black_mode ,
81
84
skip_errors = skip_errors ,
82
85
rst_literal_blocks = rst_literal_blocks ,
86
+ check_only = check_only ,
83
87
)
84
88
return retv
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def __init__(
29
29
magic_trailing_comma : bool = True ,
30
30
python_cell_magics : set [str ] | None = None ,
31
31
preview : bool = False ,
32
+ check_only : bool = False ,
32
33
) -> None :
33
34
"""Run `blacken-docs`.
34
35
@@ -49,6 +50,8 @@ def __init__(
49
50
Useful for formatting cells with custom python magics.
50
51
preview: Enable potentially disruptive style changes that may be added
51
52
to Black's main functionality in the next major release.
53
+ check_only: Don't modify files but indicate when changes are necessary
54
+ with a message and non-zero return code.
52
55
53
56
Returns:
54
57
Success/failure.
@@ -77,6 +80,7 @@ def __call__(self) -> int:
77
80
preview = self .py_args ["preview" ]
78
81
skip_errors = self .py_args ["skip_errors" ]
79
82
rst_literal_blocks = self .py_args ["rst_literal_blocks" ]
83
+ check_only = self .py_args ["check_only" ]
80
84
81
85
# Build filepaths.
82
86
exts = ("md" , "py" ) if exts is None else tuple (ext .lstrip ("." ) for ext in exts )
@@ -111,5 +115,6 @@ def __call__(self) -> int:
111
115
black_mode ,
112
116
skip_errors = skip_errors ,
113
117
rst_literal_blocks = rst_literal_blocks ,
118
+ check_only = check_only ,
114
119
)
115
120
return retv
You can’t perform that action at this time.
0 commit comments