MCPcopy Index your code
hub / github.com/python/mypy / _add_strict_list

Method _add_strict_list

docs/source/html_builder.py:30–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self._ref_to_doc.update({_id: docname for _id in doctree.ids})
29
30 def _add_strict_list(self) -> None:
31 strict_flags: list[str]
32 _, strict_flags, _ = define_options()
33 strict_part = ", ".join(f":option:`{s} <mypy {s}>`" for s in strict_flags)
34 if (
35 not strict_part
36 or strict_part.isspace()
37 or len(strict_part) < 20
38 or len(strict_part) > 2000
39 ):
40 raise ValueError(f"{strict_part=}, which doesn't look right (by a simple heuristic).")
41 self.strict_file.write_text(
42 "For this version of mypy, the list of flags enabled by strict is: " + strict_part
43 )
44
45 def _verify_error_codes(self) -> None:
46 from mypy.errorcodes import error_codes

Callers 1

__init__Method · 0.95

Calls 5

define_optionsFunction · 0.90
lenFunction · 0.85
ValueErrorClass · 0.85
isspaceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected