v2.0.0-rc.8 #415
v2.0.0-rc.8
#415
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cldk v2.0.0-rc.8
A small release with one user-visible fix:
locateon a Python decorator line now answers with the decorated callable instead ofmodule_scope. It also takes up codeanalyzer-python 1.5.3.No breaking changes. The Python graph floor stays at codeanalyzer-python 1.5.0; nothing that attached to rc.7 is refused by rc.8.
locateplaces a decorator line on the callable it decorates (#408)PyCallable.start_lineis thedefline, because codeanalyzer-python takes it fromast.FunctionDef.lineno, and Python's AST puts decorators above that line. So a scanner alert on@http.route('/crm/notes/...', auth='user')sat inside no callable span, andlocatereported it as module scope. It is not; it is the routed method's.Both backends now read where the decorator is applied. The local backend reads
PyCallable.decorators[].span. The Neo4j backend readsPY_DECORATED_BY.start_line, which codeanalyzer-python 1.5.2 emits. Every line from the first decorator through the callable's last line resolves to that callable, including a line between two decorators, anddiagnosticsis empty for it.Three things stay as they were, each pinned by a test:
module_scope. This is not a nearest-callable fallback.module_scope. A result withtypeset andcallableunset would be a new shape, and that decision is not made here.A decorator on a nested function resolves to the nested function, because ranking is unchanged: the def-based width, and the nested span is narrower.
Measured on odoo-slim-19 re-emitted by codeanalyzer-python 1.5.3, 40 positions (20 decorator lines, 20 body lines), median of 5, same graph both ways: 71.0 ms placing 20 of 40 before, 70.2 ms placing 40 of 40 after. The query still seeks the
pysymbol_idindex.Analyzer pin: codeanalyzer-python 1.5.3 (#410)
Two analyzer fixes. Neither moves the schema;
schema_versionand the graphSCHEMA_VERSIONboth stay2.0.0.analysis.jsonand embed it whole. This SDK's defaultcache_diris<project>/.codeanalyzer, inside the project, so every local run was exposed.getattr(o, n)(x)the outer call and the innergetattrstart at the same column, and the position-keyedbodykept only the inner one. Keys now carry a/2,/3disambiguator, outermost first. A key that used to collide now names the outer call, and a call whose callee is itself a call carriescallee_signature: nullwithmethod_name: "<unknown>". The SDK's key parser already handled the suffix.Links
All reactions