-
-
Notifications
You must be signed in to change notification settings - Fork 725
fix(linter/plugins): reset state after error during AST visitation #16246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter/plugins): reset state after error during AST visitation #16246
Conversation
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
4d8c1a9 to
fdab22e
Compare
There was a problem hiding this 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 fixes a memory leak issue by ensuring that file processing state is properly cleaned up after errors during AST visitation. The fix extracts the cleanup logic into a dedicated resetFile() function and ensures it's called in the finally block of lintFile().
Key Changes:
- Added
resetFile()call in the finally block to ensure cleanup happens even when errors occur - Extracted reset logic into a separate documented function for better code organization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…16246) If there's an error during AST visitation, ensure state is reset to free memory. This is only observable if user were to schedule some code in a later tick to access e.g. `sourceCode.text`, and that runs before the next file is linted. I've not added tests, as it'd be hard to write one which isn't flaky.
fdab22e to
0df1901
Compare

If there's an error during AST visitation, ensure state is reset to free memory.
This is only observable if user were to schedule some code in a later tick to access e.g.
sourceCode.text, and that runs before the next file is linted. I've not added tests, as it'd be hard to write one which isn't flaky.