-
Notifications
You must be signed in to change notification settings - Fork 189
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
Use correct type for AugAssign and AnnAssign target #396
Conversation
This change looks great. It makes LibCST parsing more correctly just like AST. Can you add invalid test cases to LibCST/libcst/_nodes/tests/test_assign.py Lines 269 to 285 in c023fa7
|
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.
Other than missing test cases, LGTM.
The suggested pattern does not quite work as "get_node": (
# x + 1 : int = y
lambda: cst.AnnAssign(...).validate_types_shallow()
) But this generates a I will add a new test methods ( |
Hmmm not sure what pyre is complaining about. I tried to reproduce locally but I get tons of errors on master so I must have something configured wrong. Edit: |
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.
These should silence the pyre errors (since we're intentionally constructing these types incorrectly)
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.
@cdonovick Looks good now. Thanks for contributing!
Summary
Closes #391
Changes to
libcst/matchers/__init__.py
performed bytox -e codegen
Test Plan
I couldn't find any relevant tests to extend but would be happy to write one.