Instagram / LibCST

A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
https://libcst.readthedocs.io/
Other
1.57k stars 192 forks source link

Implement PEP-696 #1141

Closed thereversiblewheel closed 6 months ago

thereversiblewheel commented 6 months ago

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: https://github.com/Instagram/LibCST/issues/1127

Test Plan

Round trip tests we're added

codecov[bot] commented 6 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.