Skip to content
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: don't reset context.scratch between files #1151

Merged
merged 1 commit into from
May 21, 2024
Merged

fix: don't reset context.scratch between files #1151

merged 1 commit into from
May 21, 2024

Conversation

zsol
Copy link
Member

@zsol zsol commented May 21, 2024

fix: don't reset context.scratch between files

#453 fixed scratch leaking between files by setting it to empty, but that drops all the scratch space that was set up before the codemod runs (e.g. in the transformer's constructor)

This PR improves the fix by preserving the initial scratch.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 21, 2024
@zsol zsol marked this pull request as draft May 21, 2024 17:30
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.16%. Comparing base (71b0a12) to head (6adb8c3).

Files Patch % Lines
libcst/tests/test_e2e.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1151      +/-   ##
==========================================
- Coverage   91.16%   91.16%   -0.01%     
==========================================
  Files         262      262              
  Lines       26836    26842       +6     
==========================================
+ Hits        24465    24470       +5     
- Misses       2371     2372       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

#453 fixed scratch leaking between files by setting it to empty, but that drops all the scratch space that was set up before the codemod runs (e.g. in the transformer's constructor)

This PR improves the fix by preserving the initial scratch.
@zsol zsol marked this pull request as ready for review May 21, 2024 19:52
@zsol zsol merged commit db696e6 into main May 21, 2024
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants