MCPcopy Index your code
hub / github.com/praw-dev/praw / check

Method check

tools/check_documentation.py:46–70  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

44
45 @classmethod
46 def check(cls):
47 cls.subclasses |= cls.discover_subclasses(cls.BASE_SEARCH_CLASS.__subclasses__())
48 cls.exceptions |= cls.discover_subclasses(cls.exceptions)
49 success = True
50 for subclass in cls.subclasses:
51 if subclass in cls.exceptions:
52 continue
53 if not cls.HAS_ATTRIBUTE_TABLE.search(subclass.__doc__):
54 print(f"Subclass {subclass.__module__}.{subclass.__name__} is missing a table of common attributes.")
55 success = False
56 for method_name in dir(subclass):
57 if method_name in cls.METHOD_EXCEPTIONS:
58 continue
59 method = getattr(subclass, method_name)
60 if (callable(method) or isinstance(method, cachedproperty)) and not method_name.startswith("_"):
61 if isinstance(method, cachedproperty):
62 method = method.func
63 if not cls.HAS_CODE_BLOCK.search(method.__doc__):
64 print(
65 "Method"
66 f" {subclass.__module__}.{subclass.__name__}.{method.__name__}"
67 " is missing code examples."
68 )
69 success = False
70 return success
71
72
73def main():

Callers 1

mainFunction · 0.80

Calls 2

discover_subclassesMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected