From dd950392c851037e513035a47628ea77219b3dd9 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 2 Jul 2017 22:12:02 +0200 Subject: [PATCH] Remove E999 for now, because those issues are not defined. Also change a few small things where issues were wrong. --- parso/python/normalizer.py | 2 ++ test/normalizer_issue_files/E10.py | 5 ++--- test/normalizer_issue_files/E72.py | 6 +++--- test/test_normalizer_issues_files.py | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/parso/python/normalizer.py b/parso/python/normalizer.py index 73951e4..96a526e 100644 --- a/parso/python/normalizer.py +++ b/parso/python/normalizer.py @@ -511,6 +511,8 @@ class PEP8Normalizer(Normalizer): and leaf.parent.type not in ('subscript', 'subscriptlist'): message = "Whitespace before '%s'" % leaf.value add_if_spaces(203, message, spacing) + elif prev == ':' and prev.parent.type in ('subscript', 'subscriptlist'): + pass # TODO elif prev in (',', ';', ':'): add_not_spaces('231', "missing whitespace after '%s'", spacing) elif leaf == ':': # Is a subscript diff --git a/test/normalizer_issue_files/E10.py b/test/normalizer_issue_files/E10.py index 1a1deb8..d23d1d2 100644 --- a/test/normalizer_issue_files/E10.py +++ b/test/normalizer_issue_files/E10.py @@ -2,7 +2,7 @@ for a in 'abc': for b in 'xyz': print a # indented with 8 spaces #: W101:0 - print b # indented with 1 tab + print(b) # indented with 1 tab if True: #: W101:0 pass @@ -29,9 +29,8 @@ class TestP4Poller(unittest.TestCase): # if True: - #: E101:0 + #: E101:0 E101+1:0 foo(1, - #: E101:0 2) def test_keys(self): diff --git a/test/normalizer_issue_files/E72.py b/test/normalizer_issue_files/E72.py index 9661adc..2e9ef91 100644 --- a/test/normalizer_issue_files/E72.py +++ b/test/normalizer_issue_files/E72.py @@ -26,11 +26,11 @@ assert type(res) == type((0,)) #: E721:7 assert type(res) == type((0)) #: E721:7 -assert type(res) != type((1, )) +assert type(res) != type((1,)) #: E721:7 -assert type(res) is type((1, )) +assert type(res) is type((1,)) #: E721:7 -assert type(res) is not type((1, )) +assert type(res) is not type((1,)) # Okay #: E402 diff --git a/test/test_normalizer_issues_files.py b/test/test_normalizer_issues_files.py index 0cd610d..373a924 100644 --- a/test/test_normalizer_issues_files.py +++ b/test/test_normalizer_issues_files.py @@ -44,6 +44,8 @@ def collect_errors(code): code, _, add_line = code.partition('+') l = line_nr + 1 + int(add_line or 0) + if code == 'E999': continue # TODO delete + yield WantedIssue(code[1:], l, column)