feat(transformer_plugins): add changed field to InjectGlobalVariablesReturn#14618
Merged
graphite-app[bot] merged 1 commit intomainfrom Oct 15, 2025
Merged
Conversation
Contributor
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a changed flag to track whether the AST was modified during the inject_global_variables transformation, enabling callers to detect modifications without diffing the AST.
- Add changed: bool to InjectGlobalVariablesReturn and pipeline state
- Set changed when imports are injected and when dot-define member expressions are replaced
- Return changed from build in all code paths
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bd10f2b to
67c13e3
Compare
Member
Author
Merge activity
|
graphite-app bot
pushed a commit
that referenced
this pull request
Oct 15, 2025
…Return (#14618) ## Summary Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation. - Adds `changed` field to `InjectGlobalVariablesReturn` struct - Tracks changes via consolidated `mark_as_changed()` helper method - Updates `replace_dot_defines` when dot define replacements occur - Updates `inject_imports` when import statements are injected - Updates `build` method to return `changed` in all paths This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation. ## Test plan - [x] All existing tests pass - [x] No new tests needed - change tracking is straightforward 🤖 Generated with [Claude Code](https://claude.com/claude-code)
67c13e3 to
6daf3c2
Compare
…Return (#14618) ## Summary Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation. - Adds `changed` field to `InjectGlobalVariablesReturn` struct - Tracks changes via consolidated `mark_as_changed()` helper method - Updates `replace_dot_defines` when dot define replacements occur - Updates `inject_imports` when import statements are injected - Updates `build` method to return `changed` in all paths This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation. ## Test plan - [x] All existing tests pass - [x] No new tests needed - change tracking is straightforward 🤖 Generated with [Claude Code](https://claude.com/claude-code)
6daf3c2 to
2f85b31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
changed: boolfield toInjectGlobalVariablesReturnto track whether the AST was modified during the global variable injection transformation.changedfield toInjectGlobalVariablesReturnstructmark_as_changed()helper methodreplace_dot_defineswhen dot define replacements occurinject_importswhen import statements are injectedbuildmethod to returnchangedin all pathsThis allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation.
Test plan
🤖 Generated with Claude Code