Skip to content

Commit f9e20e6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 13787f8 commit f9e20e6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/source/html_builder.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from mypy.main import process_options
1515

16+
1617
class MypyHTMLBuilder(StandaloneHTMLBuilder):
1718
def __init__(self, app: Sphinx, env: BuildEnvironment) -> None:
1819
super().__init__(app, env)
@@ -25,9 +26,16 @@ def write_doc(self, docname: str, doctree: document) -> None:
2526

2627
def _add_strict_list(self) -> None:
2728
p = Path(self.outdir).parent.parent / "source" / "strict_list.rst"
28-
strict_part = ", ".join(f":option:`{s} <mypy {s}>`" for s in process_options(['-c', 'pass'])[2])
29-
if not strict_part or strict_part.isspace() or len(strict_part) < 20 or len(strict_part) > 2000:
30-
raise ValueError(f"{strict_part=}, which doesn't look right (by a simple heuristic).")
29+
strict_part = ", ".join(
30+
f":option:`{s} <mypy {s}>`" for s in process_options(["-c", "pass"])[2]
31+
)
32+
if (
33+
not strict_part
34+
or strict_part.isspace()
35+
or len(strict_part) < 20
36+
or len(strict_part) > 2000
37+
):
38+
raise ValueError(f"{strict_part=}, which doesn't look right (by a simple heuristic).")
3139
p.write_text(strict_part)
3240

3341
def _verify_error_codes(self) -> None:

0 commit comments

Comments
 (0)