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

Add support for For and With #607

Merged

Conversation

stroxler
Copy link
Contributor

Summary

For both For and With, we convert a statement with a type comment into multiple
statements, with SimpleStatementLines containing type declarations (i.e. AnnAssign statements)
preceding the original For / With.

Test Plan

Unit tests - added tests of both transforms and cases (e.g. arity errors, multiple with bindings)
that we don't support because the PEP 484 spec doesn't.

@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 Jan 16, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #607 (5e7c0f6) into main (91212cd) will decrease coverage by 0.00%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #607      +/-   ##
==========================================
- Coverage   94.78%   94.77%   -0.01%     
==========================================
  Files         245      245              
  Lines       25101    25140      +39     
==========================================
+ Hits        23791    23826      +35     
- Misses       1310     1314       +4     
Impacted Files Coverage Δ
libcst/codemod/commands/convert_type_comments.py 94.69% <87.50%> (-2.34%) ⬇️
...demod/commands/tests/test_convert_type_comments.py 95.34% <100.00%> (+1.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91212cd...5e7c0f6. Read the comment docs.

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.

4 participants