(cls)
| 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 | |
| 73 | def main(): |
no test coverage detected