Skip to content

Conversation

@tausbn
Copy link
Contributor

@tausbn tausbn commented Dec 5, 2025

WIP

@github-actions github-actions bot added the Python label Dec 5, 2025
... and everything else that it depends on.
@tausbn tausbn force-pushed the tausbn/python-add-ast-overlay-annotations branch from 6930b04 to 09e1f8d Compare December 5, 2025 13:31
@tausbn tausbn added the no-change-note-required This PR does not need a change note label Dec 17, 2025
@tausbn tausbn marked this pull request as ready for review December 17, 2025 12:35
Copilot AI review requested due to automatic review settings December 17, 2025 12:35
@tausbn tausbn requested a review from a team as a code owner December 17, 2025 12:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds overlay annotations to Python QL AST-related classes and modules to support the overlay system. The changes involve adding module-level overlay[local] annotations and introducing final class wrappers to enable proper class extension patterns.

Key changes:

  • Added overlay[local] and overlay[global] annotations to approximately 25 QL library files and modules
  • Introduced final class type aliases (e.g., final class FinalAstNode = AstNode) to support the overlay pattern
  • Refactored class inheritance to use instanceof syntax where appropriate

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
python/ql/src/analysis/ImportFailure.ql Added final class wrapper and converted VersionTest to extend it, removed override keyword from toString
python/ql/src/Variables/LoopVariableCapture/LoopVariableCaptureQuery.qll Added final class wrapper and converted ForLoop to use instanceof syntax
python/ql/lib/semmle/python/types/ImportTime.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/types/Builtins.qll Added overlay[local?] module annotation with question mark
python/ql/lib/semmle/python/internal/CachedStages.qll Added overlay[local] to AST module
python/ql/lib/semmle/python/essa/SsaDefinitions.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/essa/SsaCompute.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/essa/Essa.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/essa/Definitions.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Variables.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Stmts.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Scope.qll Added overlay[local] module annotation and overlay[global] to specific predicates
python/ql/lib/semmle/python/SSA.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Patterns.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Operations.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Module.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Keywords.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Import.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/GuardedControlFlow.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Function.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Flow.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Files.qll Added overlay[local] module annotation and overlay[global] to getChildContainer method
python/ql/lib/semmle/python/Exprs.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Constants.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Comprehensions.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Comment.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/Class.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/AstGenerated.qll Added overlay[local] module annotation
python/ql/lib/semmle/python/AstExtended.qll Added overlay[local] module annotation
python/ql/lib/analysis/DefinitionTracking.qll Added final class wrapper and refactored NiceLocationExpr, removed redundant toString override

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,3 +1,6 @@
overlay[local?]
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlay annotation uses 'local?' with a question mark. This appears to be inconsistent with other files which use either 'local' or 'global'. If this is intentional to indicate optional behavior, it should be documented. If not, it should be corrected to match the standard 'overlay[local]' pattern used in other files.

Copilot generated this review using guidance from repository custom instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants