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

WPS344 ignores //= 0 #974

Closed
sobolevn opened this issue Nov 4, 2019 · 0 comments
Closed

WPS344 ignores //= 0 #974

sobolevn opened this issue Nov 4, 2019 · 0 comments
Labels
bug Something isn't working Hacktoberfest Hactoberfest fun! help wanted Extra attention is needed level:starter Good for newcomers
Milestone

Comments

@sobolevn
Copy link
Member

sobolevn commented Nov 4, 2019

Bug report

What's wrong

This code is not marked as invalid:

x //= 0

How is that should be

It should raise WPS344. See here: https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/visitors/ast/operators.py#L100

We also need to check for ast.FloorDiv as well.
And edit a test here: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/test_ast/test_operators/test_useless_math.py#L46

System information

flake8 information

Contents of flake8 --bug-report:

pip information

Contents of pip freeze:

@sobolevn sobolevn added bug Something isn't working help wanted Extra attention is needed level:starter Good for newcomers Hacktoberfest Hactoberfest fun! labels Nov 4, 2019
@sobolevn sobolevn added this to the Version 0.13 milestone Nov 4, 2019
ko3luhbka pushed a commit to ko3luhbka/wemake-python-styleguide that referenced this issue Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hacktoberfest Hactoberfest fun! help wanted Extra attention is needed level:starter Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant