Skip to content

Commit e3813ab

Browse files
committed
Do not report multiple E101 if only one line starts with a tab; issue #237
1 parent 6ffa51a commit e3813ab

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Changelog
2323
* The logical checks can return ``None`` instead of an empty iterator.
2424
(Issue #250)
2525

26+
* Do not report multiple E101 if only the first indentation starts
27+
with a tab. (Issue #237)
28+
2629

2730
1.4.6 (2013-07-02)
2831
------------------

pep8.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,8 @@ def check_physical(self, line):
12891289
if result is not None:
12901290
(offset, text) = result
12911291
self.report_error(self.line_number, offset, text, check)
1292+
if text[:4] == 'E101':
1293+
self.indent_char = line[0]
12921294

12931295
def build_tokens_line(self):
12941296
"""

testsuite/E10.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,26 @@
33
for b in 'xyz':
44
print a # indented with 8 spaces
55
print b # indented with 1 tab
6+
#: E101 E122 W191 W191
7+
if True:
8+
pass
9+
10+
change_2_log = \
11+
"""Change 2 by slamb@testclient on 2006/04/13 21:46:23
12+
13+
creation
14+
"""
15+
16+
p4change = {
17+
2: change_2_log,
18+
}
19+
20+
21+
class TestP4Poller(unittest.TestCase):
22+
def setUp(self):
23+
self.setUpGetProcessOutput()
24+
return self.setUpChangeSource()
25+
26+
def tearDown(self):
27+
pass
28+
#:

testsuite/E90.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
}
33
#: E901
44
= [x
5-
#: E901 E101 E101 W191 W191
5+
#: E901 E101 W191 W191
66
while True:
77
try:
88
pass

0 commit comments

Comments
 (0)