INNER CODE UNIT · Python

annotation_checkers

uber/NullAway · scripts/nullaway-suppression-remover/src/suppression_remover/core.py:161

def annotation_checkers(node: ts.Node) -> list[str]:
    results: list[str] = []
    _collect_strings(node, results)
    return results


def _collect_strings(node: ts.Node, results: list[str]) -> None:
    if node.type == "string_literal" and node.text:
        text = node.text.decode()
        if len(text) >= 2 and text[0] == '"' and text[-1] == '"':
            results.append(text[1:-1])
        return
    for child in node.children:
        _collect_strings(child, results)


def _string_literal_nodes(node: ts.Node) -> list[ts.Node]:
    """Return the string-literal descendants of *node* in source order."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…