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 space validation for AsName and Await #641

Merged
merged 2 commits into from
Feb 10, 2022

Conversation

zsol
Copy link
Member

@zsol zsol commented Feb 8, 2022

Summary

Fixes #633. Unfortunately we have to move the validation of AsName to its parent because of different rules for different parents as well as the need for the preceding expression.

Test Plan

Added unit tests.

@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 Feb 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #641 (f5e7829) into main (f0cca36) will increase coverage by 0.00%.
The diff coverage is 76.92%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #641   +/-   ##
=======================================
  Coverage   94.78%   94.78%           
=======================================
  Files         245      245           
  Lines       25281    25297   +16     
=======================================
+ Hits        23963    23979   +16     
  Misses       1318     1318           
Impacted Files Coverage Δ
libcst/_nodes/tests/test_await.py 100.00% <ø> (ø)
libcst/_nodes/tests/test_import.py 100.00% <ø> (ø)
libcst/_nodes/tests/test_try.py 100.00% <ø> (ø)
libcst/_nodes/statement.py 94.94% <75.00%> (-0.11%) ⬇️
libcst/_nodes/expression.py 96.78% <100.00%> (ø)
libcst/_parser/tests/test_parse_errors.py 100.00% <0.00%> (ø)
libcst/codemod/visitors/_apply_type_annotations.py 95.18% <0.00%> (ø)
libcst/_parser/base_parser.py 89.28% <0.00%> (+2.38%) ⬆️

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 f0cca36...f5e7829. Read the comment docs.

Copy link
Contributor

@stroxler stroxler left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@stroxler
Copy link
Contributor

stroxler commented Feb 9, 2022

Whoops, looks like there's a type check error.

I'm not immediately seeing the cause, it doesn't seem to be on a line changed by this commit.

Copy link
Contributor

@stroxler stroxler left a comment

Choose a reason for hiding this comment

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

I think I found the typecheck problem, once that's patched we should be good to merge.

libcst/_nodes/tests/test_import.py Outdated Show resolved Hide resolved
@stroxler stroxler merged commit 3af6820 into Instagram:main Feb 10, 2022
@zsol
Copy link
Member Author

zsol commented Feb 10, 2022

hehe thanks!

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.

Incorrect CST node validation: space is not necessary
4 participants