Skip to content

Commit 3f340b8

Browse files
committed
Split E125 for visual indent versus hanging indent; issue #126
1 parent b48efd3 commit 3f340b8

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Changelog
77

88
* Honor ``# noqa`` for errors E711 and E712. (Issue #180)
99

10+
* Report E129 instead of E125 for visually indented line with same
11+
indent as next logical line. (Issue #126)
12+
1013

1114
1.4.5 (2013-03-06)
1215
------------------

docs/intro.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,16 @@ This is the current list of error and warning codes:
199199
+----------+----------------------------------------------------------------------+
200200
| E124 (^) | closing bracket does not match visual indentation |
201201
+----------+----------------------------------------------------------------------+
202-
| E125 (^) | continuation line does not distinguish itself from next logical line |
202+
| E125 (^) | continuation line with same indent as next logical line |
203203
+----------+----------------------------------------------------------------------+
204204
| E126 (^) | continuation line over-indented for hanging indent |
205205
+----------+----------------------------------------------------------------------+
206206
| E127 (^) | continuation line over-indented for visual indent |
207207
+----------+----------------------------------------------------------------------+
208208
| E128 (^) | continuation line under-indented for visual indent |
209209
+----------+----------------------------------------------------------------------+
210+
| E129 (^) | visually indented line with same indent as next logical line |
211+
+----------+----------------------------------------------------------------------+
210212
+----------+----------------------------------------------------------------------+
211213
| **E2** | *Whitespace* |
212214
+----------+----------------------------------------------------------------------+

pep8.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,11 @@ def continued_indentation(logical_line, tokens, indent_level, noqa, verbose):
542542
last_token_multiline = (start[0] != end[0])
543543

544544
if indent_next and rel_indent[-1] == 4:
545-
yield (last_indent, "E125 continuation line does not distinguish "
546-
"itself from next logical line")
545+
if visual_indent:
546+
code = "E129 visually indented line"
547+
else:
548+
code = "E125 continuation line"
549+
yield (last_indent, "%s with same indent as next logical line" % code)
547550

548551

549552
def whitespace_before_parameters(logical_line, tokens):

testsuite/E12.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#: E124
1616
a = (123,
1717
)
18-
#: E125
18+
#: E129
1919
if (row < 0 or self.moduleCount <= row or
2020
col < 0 or self.moduleCount <= col):
2121
raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
@@ -92,7 +92,7 @@ def qualify_by_address(
9292
self, cr, uid, ids, context=None,
9393
params_to_check=frozenset(QUALIF_BY_ADDRESS_PARAM)):
9494
""" This gets called by the web server """
95-
#: E125
95+
#: E129
9696
if (a == 2 or
9797
b == "abc def ghi"
9898
"jkl mno"):

0 commit comments

Comments
 (0)