Conversation
Only trivial test changes.
|
DCA results look good. 14 new results (that appear to be to be true positives), 4 results lost, one false positive and three true positives (the latter due to incomplete modelling of inheritance, e.g. no understanding of classes that extend built-in types). I don't think we need a specific change note for this. It's but one of a large number of such query ports, so it's probably more useful to make a unified change note at a later point. |
There was a problem hiding this comment.
Pull request overview
Ports the Python query ShouldUseWithStatement.ql to rely on the newer DataFlowDispatch internals (class tracking + duck typing) rather than the legacy points-to approach, keeping the query-test expectations in sync.
Changes:
- Switch
ShouldUseWithStatement.qlto useclassInstanceTrackerfromDataFlowDispatch. - Replace the old context-manager check with
DuckTyping::isContextManager. - Update the
.expectedoutput to reflect the new class entity rendering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/ql/src/Statements/ShouldUseWithStatement.ql | Moves the query to the new internal class-tracking and duck-typing utilities. |
| python/ql/test/query-tests/Statements/general/ShouldUseWithStatement.expected | Updates expected results to match the query’s updated class representation. |
Uses the (internal) class tracker from
DataFlowDispatchas well as the new duck typing module.Only trivial test changes.