Skip to content

structlint.collection

Class and functions tasked with finding and processing code objects in the source files.

Objects

Dataclass to hold information collected on objects.

Used with source, test, and documentation objects, but only one of these per instance.

classes = add_inherited_methods(classes) instance-attribute

functions = functions instance-attribute

function_strings: list[str] property

method_strings: list[str] property

methodless: list[str] property

strings: list[str] property

apply(processor: Callable[[str], str], ignore: re.Pattern | None = None, classes_only: bool = False) -> list[str]

collect_method_info(class_text: str) -> ClassInfoBase

parse_function(src_text: str, condition: Callable[[str], bool] = always_true) -> str

collect_objects_in_md(src_text: str, condition: Callable[[str], bool] = always_true) -> list[tuple[int, str]]

collect_docs_objects(md_dir: Path, project_root: Path) -> Objects

collect_object_texts(source: str) -> list[str]

collect_source_objects(src_dir: Path, root_dir: Path) -> Objects

add_inherited_methods(class_tuples: list[ClassInfo]) -> list[ClassInfo]