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

E225 Check for space around boolean operators #847

Merged
merged 2 commits into from Mar 1, 2019

Conversation

adamchainz
Copy link
Contributor

This was documented in the docstring for missing_whitespace_around_operator but not implemented, allowing e.g. 1and 0 to pass. Fixed by adding test case then modifying the check to search for the 'and' and 'or' operators as well.

This was documented in the docstring for `missing_whitespace_around_operator` but not implemented, allowing e.g. `1and 0` to pass. Fixed by adding test case then modifying the check to search for the 'and' and 'or' operators as well.
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

#: E225
i = 1and 1
#: E225
i = 1or 0
Copy link
Member

Choose a reason for hiding this comment

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

here's a few more:

1is 1
1not in []
1in []

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added support for 'is' and 'not', updating for the two-word 'not in' is beyond me right now (07:30 after a long haul flight...)

@sigmavirus24 sigmavirus24 merged commit d1e2986 into PyCQA:master Mar 1, 2019
@adamchainz adamchainz deleted the E225_boolean_operators branch March 1, 2019 13:28
@adamchainz
Copy link
Contributor Author

Thanks @asottile for review and @sigmavirus24 for merge!

@sigmavirus24
Copy link
Member

Thanks for the fix! When you're less jet-lagged and feel like puzzling out not in, feel free to send another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants