Analyzer::Python::Starlette
Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object
Constants
Hoisted out of the analyze loops: an interpolated regex literal
recompiles (PCRE2 JIT) on every evaluation, and these interpolate
only constants. The .to_s expansion is byte-identical to the
previous inline form, so matching behaviour is unchanged.
X = Starlette( / X = Router( whose routes=[...] list is inline.
Mount('/p', app=sub) or Mount('/p', sub): the prefix and the
mounted app's name. A call (app=StaticFiles(...)) or a keyword in
the second slot (routes=[...]) is not an app name.
Mount('/prefix', routes=[...]) — only the prefix literal is needed;
the routes list is scanned via the ongoing line loop while the mount
is on the paren stack. A Mount whose second argument is an app —
app=sub, a positional sub (both wired through MOUNT_APP_RE) or a
positional call such as StaticFiles(...) — holds no routes of its
own, so it must not prefix routes that merely share its line
(routes=[Route("/h", h), Mount("/v2", app=sub)]).
Path param in a route pattern: {name} or {name:type}. Starlette uses the :type suffix as a converter hint (int, str, float, uuid, path); it is stripped before the param is exposed as a path param.
Route('/path', handler, methods=[...]) — captures path, and the tail after the path literal so we can inspect methods= and the handler reference. The tail stops at the closing paren on the same line to keep the match cheap; multi-line Route() calls are still covered for the common (path, handler, methods) shape.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.