From 3329324317d35cea5f28b2188cc91d478bee158f Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Tue, 6 Feb 2024 10:54:49 -0800 Subject: [PATCH] WIP --- .github/scripts/build-ghautodoc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/build-ghautodoc.py b/.github/scripts/build-ghautodoc.py index 6de3bab..321e1c7 100644 --- a/.github/scripts/build-ghautodoc.py +++ b/.github/scripts/build-ghautodoc.py @@ -156,13 +156,13 @@ def get_node_annotation(node, node_type): def get_documentables(module_node): documentables = defaultdict(dict) for node in module_node.body: - if node.name.startswith("_"): - continue - if isinstance(node, ast.FunctionDef): + if isinstance(node, ast.FunctionDef) and not node.name.startswith("_"): documentables[node.lineno] = get_node_annotation(node, "function") - elif isinstance(node, ast.ClassDef): + elif isinstance(node, ast.ClassDef) and not node.name.startswith("_"): documentables[node.lineno] = get_node_annotation(node, "class") for subnode in node.body: + if subnode.name.startswith("_"): + continue if isinstance(subnode, ast.FunctionDef): documentables[subnode.lineno] = get_node_annotation( subnode, "method"