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

Implement PEP-696 #1141

Merged
merged 14 commits into from
May 20, 2024
Merged

Implement PEP-696 #1141

merged 14 commits into from
May 20, 2024

Conversation

thereversiblewheel
Copy link
Contributor

Summary

This PR adds the ability for LibCST to parse the "=" operator inside of the square brackets as outlined in PEP-696

Major Changes

Additional python tests were added
Additional roundtrip tests were added (taken from the cython implementation)

##Related Links

PEP-696: https://peps.python.org/pep-0696/#grammar-changes
Issue: #1127

Test Plan

Round trip tests we're added

@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 8, 2024
Copy link

codecov bot commented May 9, 2024

Codecov Report

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

Project coverage is 91.15%. Comparing base (9f54920) to head (a4a0147).
Report is 11 commits behind head on main.

Files Patch % Lines
libcst/_nodes/statement.py 87.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1141      +/-   ##
==========================================
+ Coverage   91.12%   91.15%   +0.02%     
==========================================
  Files         256      258       +2     
  Lines       26567    26740     +173     
==========================================
+ Hits        24210    24374     +164     
- Misses       2357     2366       +9     

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

Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

lgtm at a high level, I have some minor comments, the most important thing is to fix the ordering of inflate statements.
Also pls add more test cases for roundtrip

libcst/_nodes/statement.py Outdated Show resolved Hide resolved
libcst/_nodes/statement.py Outdated Show resolved Hide resolved
libcst/_nodes/statement.py Outdated Show resolved Hide resolved
native/libcst/src/nodes/statement.rs Outdated Show resolved Hide resolved
native/libcst/src/parser/grammar.rs Show resolved Hide resolved
@thereversiblewheel thereversiblewheel marked this pull request as ready for review May 14, 2024 14:29
Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

Looks great, thanks :)

@zsol zsol merged commit 71b0a12 into main May 20, 2024
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.

None yet

3 participants