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

E702 fixes code incorrectly #364

Closed
ancc opened this issue Dec 5, 2017 · 2 comments
Closed

E702 fixes code incorrectly #364

ancc opened this issue Dec 5, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@ancc
Copy link

ancc commented Dec 5, 2017

autopep8 version 1.3.3
With following code:

for i in range(3):
    if i == 1: print i;continue
    print i

output is:
0
1
2

after running
autopep8 -i --select=E702

code will be

for i in range(3):
    if i == 1: print i
    continue
    print i

and output is
1

correct is

for i in range(3):
    if i == 1: print i
        continue
    print i
@hhatto
Copy link
Owner

hhatto commented Dec 21, 2017

Thanks for reporting.

for i in range(3):
    if i == 1: print i
        continue
    print i

this is invalid python code.

As one of the suggested solutions to not fix if there is E701 and E702 on same line.

@hhatto hhatto added the bug label Mar 30, 2018
@hhatto hhatto self-assigned this Nov 13, 2018
@hhatto hhatto added this to the 1.5.2 milestone Apr 11, 2020
@hhatto
Copy link
Owner

hhatto commented Apr 11, 2020

fix in latest master.
If E701 and E702 exist in the same line, do not correct them.

We will be releasing version 1.5.2 with this fix in next week.

Thanks

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

No branches or pull requests

2 participants