Skip to content

Commit

Permalink
Merge pull request #642 from hhatto/support-e275
Browse files Browse the repository at this point in the history
Support E275
  • Loading branch information
hhatto committed Aug 6, 2022
2 parents e8bc5e5 + 0eacca1 commit 812ce46
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
3 changes: 2 additions & 1 deletion autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class FixPEP8(object):
- e231
- e251,e252
- e261,e262
- e271,e272,e273,e274
- e271,e272,e273,e274,e275
- e301,e302,e303,e304,e305,e306
- e401,e402
- e502
Expand Down Expand Up @@ -525,6 +525,7 @@ def __init__(self, filename,
self.fix_e272 = self.fix_e271
self.fix_e273 = self.fix_e271
self.fix_e274 = self.fix_e271
self.fix_e275 = self.fix_e271
self.fix_e306 = self.fix_e301
self.fix_e501 = (
self.fix_long_line_logically if
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


INSTALL_REQUIRES = (
['pycodestyle >= 2.9.0', 'toml']
['pycodestyle >= 2.9.1', 'toml']
)


Expand Down
23 changes: 23 additions & 0 deletions test/suite/E27.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#: E275
from w import(e, f)
#: E275
from importable.module import(e, f)
#: E275
try:
from importable.module import(e, f)
except ImportError:
pass
#: Okay
True and False
#: E271
Expand Down Expand Up @@ -28,3 +37,17 @@
a and b
#: E273 E274
this and False
#: E275
if(foo):
pass
else:
pass
#: Okay
matched = {"true": True, "false": False}
#: E275:2:11
if True:
assert(1)
#: Okay
def f():
print((yield))
x = (yield)
25 changes: 25 additions & 0 deletions test/suite/out/E27.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#: E275
from w import (e, f)
#: E275
from importable.module import (e, f)
#: E275
try:
from importable.module import (e, f)
except ImportError:
pass
#: Okay
True and False
#: E271
Expand Down Expand Up @@ -28,3 +37,19 @@
a and b
#: E273 E274
this and False
#: E275
if (foo):
pass
else:
pass
#: Okay
matched = {"true": True, "false": False}
#: E275:2:11
if True:
assert (1)
#: Okay


def f():
print((yield))
x = (yield)
6 changes: 3 additions & 3 deletions test/suite/out/W19.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
#: E101 E101 W191 W191
if start[1] > end_col and not (
over_indent == 4 and indent_next):
return(0, "E121 continuation line over-"
"indented for visual indent")
return (0, "E121 continuation line over-"
"indented for visual indent")
#:

#: E101 W191
Expand All @@ -60,7 +60,7 @@ def long_function_name(
raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
#: E101 E101 E101 E101 W191 W191 W191 W191 W191 W191
if bar:
return(
return (
start, 'E121 lines starting with a '
'closing bracket should be indented '
"to match that of the opening "
Expand Down

0 comments on commit 812ce46

Please sign in to comment.