INNER CODE UNIT · Python

_collect

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

def _collect(node: ts.Node, results: list[ts.Node]) -> None:
    if node.type == "annotation":
        name = node.child_by_field_name("name")
        if name and name.text == b"SuppressWarnings":
            results.append(node)
            return
    for child in node.children:
        _collect(child, results)


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:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…