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

Multiple #autopep8: off/on directives in one file do not work #603

Closed
JLVarjo opened this issue Jul 7, 2021 · 1 comment
Closed

Multiple #autopep8: off/on directives in one file do not work #603

JLVarjo opened this issue Jul 7, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@JLVarjo
Copy link

JLVarjo commented Jul 7, 2021

See the example below: when there are multiple #autopep8: off/on blocks in a file, they do not seem to be respected anymore. Enclosing both lists within just one such block works correctly.


Python Code

# autopep8: off
myneatlist=[
    ("foo",      1,),
    ("bar",      2,),
    ("foobar",   3,),
]

# autopep8: on
# autopep8: off

myneatlist2=[
    ("foo",      1,),
    ("bar",      2,),
    ("foobar",   3,),
]
# autopep8: on

Configuration

.pep8:

[pycodestyle]
max_line_length = 175
#E302 - Add missing 2 blank lines.
#E305 - Expected 2 blank lines after end of function or class.
#E701 - Put colon-separated compound statement on separate lines.
ignore = E302, E305, E701
  • Python version: 3.9.2
  • autopep8 version: 1.5.7
  • Platform: Windows 10, using autopep8 via VS code
@hhatto hhatto added this to the 1.5.8 milestone Aug 15, 2021
@hhatto hhatto modified the milestones: 1.5.8, undecided Oct 21, 2021
@hhatto hhatto self-assigned this Oct 21, 2021
@hhatto hhatto added the bug label Oct 21, 2021
@hhatto hhatto modified the milestones: undecided, 1.6 Oct 24, 2021
@hhatto
Copy link
Owner

hhatto commented Oct 24, 2021

@JLVarjo
Thanks for reporting.
This problem has been fixed in version 1.6.

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