pkgcheck.bash package

Module contents

bash parsing support

class pkgcheck.bash.ParseTree(data: bytes, **kwargs)[source]

Bases: object

Bash parse tree object and support.

func_query(query: QueryCursor | SortedQueryCursor)[source]

Run a given parse tree query returning only those nodes in function scope.

global_query(query: QueryCursor | SortedQueryCursor)[source]

Run a given parse tree query returning only those nodes in global scope.

node_str(node)[source]

Return the ebuild string associated with a given parse tree node.

class pkgcheck.bash.SortedQueryCursor(query_cursor: QueryCursor)[source]

Bases: object

Sort query results by line and column. It’s been observed that query results from tree-sitter are not consistently returned in the same order, so this class acts as a decorator for QueryCursor to sort the returned captures.

captures(node)[source]
pkgcheck.bash.query(query_str: str)[source]
pkgcheck.bash.unstable_query(query_str: str) QueryCursor[source]