Skip to main content

Module python

Module python 

Source
Expand description

Python AST detection helpers powered by tree-sitter-python.

v0.2.0 replaces the regex-based Python detection from v0.1.0 with real AST queries that eliminate false positives in comments and strings.

Functions§

detect_django_fbv
Detect Django function-based views: top-level (module-level) functions whose first positional parameter is the bare identifier request.
detect_missing_typing
Walk every function_definition node and report those that have at least one parameter without a type annotation (excluding self/cls).
make_parser
Build a tree-sitter Parser configured for Python.
source_line
Return the (1-based) line_idx-th line from source as a trimmed string.