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: improve validation for ImportAlias and Try statements #340

Merged
merged 4 commits into from
Jul 14, 2020

Conversation

sk-
Copy link
Contributor

@sk- sk- commented Jul 12, 2020

Summary

For Try statements we ensure that the bare except, if present, is at the last position.

For ImportAlias we ensure that the imported name is valid.

Fixes #287

Test Plan

Unit tests

For `Try` statements we ensure that the bare except, if present, is at the last position.

For ImportAlias we ensure that the imported name is valid.

Fixes Instagram#287
@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 Jul 12, 2020
Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

libcst/_nodes/statement.py Outdated Show resolved Hide resolved
libcst/_nodes/tests/test_try.py Outdated Show resolved Hide resolved
libcst/_nodes/tests/test_try.py Outdated Show resolved Hide resolved
@jimmylai jimmylai merged commit f36eacb into Instagram:master Jul 14, 2020
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.

Should invalid code be representable?
3 participants