summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 19:20:50 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 19:20:50 +0100
commite3813abe894d71bcebd699321ccd948a3800497d (patch)
treed29ae6310df7f467763dcbdf4a451a485ac564de
parent6ffa51ae59f2d9ecc0efbc4e46d4136fb9e80421 (diff)
downloadpep8-e3813abe894d71bcebd699321ccd948a3800497d.tar.gz
Do not report multiple E101 if only one line starts with a tab; issue #237
-rw-r--r--CHANGES.txt3
-rwxr-xr-xpep8.py2
-rw-r--r--testsuite/E10.py23
-rw-r--r--testsuite/E90.py2
4 files changed, 29 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 96d879a..f6ee1be 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,9 @@ Changelog
* The logical checks can return ``None`` instead of an empty iterator.
(Issue #250)
+* Do not report multiple E101 if only the first indentation starts
+ with a tab. (Issue #237)
+
1.4.6 (2013-07-02)
------------------
diff --git a/pep8.py b/pep8.py
index 9c9ac80..a35d400 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1289,6 +1289,8 @@ class Checker(object):
if result is not None:
(offset, text) = result
self.report_error(self.line_number, offset, text, check)
+ if text[:4] == 'E101':
+ self.indent_char = line[0]
def build_tokens_line(self):
"""
diff --git a/testsuite/E10.py b/testsuite/E10.py
index 784b59a..2b3825e 100644
--- a/testsuite/E10.py
+++ b/testsuite/E10.py
@@ -3,3 +3,26 @@ for a in 'abc':
for b in 'xyz':
print a # indented with 8 spaces
print b # indented with 1 tab
+#: E101 E122 W191 W191
+if True:
+ pass
+
+change_2_log = \
+"""Change 2 by slamb@testclient on 2006/04/13 21:46:23
+
+ creation
+"""
+
+p4change = {
+ 2: change_2_log,
+}
+
+
+class TestP4Poller(unittest.TestCase):
+ def setUp(self):
+ self.setUpGetProcessOutput()
+ return self.setUpChangeSource()
+
+ def tearDown(self):
+ pass
+#:
diff --git a/testsuite/E90.py b/testsuite/E90.py
index 88df048..5da9fb9 100644
--- a/testsuite/E90.py
+++ b/testsuite/E90.py
@@ -2,7 +2,7 @@
}
#: E901
= [x
-#: E901 E101 E101 W191 W191
+#: E901 E101 W191 W191
while True:
try:
pass