Get all tests passing except those E12* tests.

You can reproduce this with "pytest -k 'not E12'".
This commit is contained in:
Dave Halter
2017-07-02 22:50:37 +02:00
parent dd950392c8
commit 602dcb11d7
2 changed files with 8 additions and 8 deletions

View File

@@ -502,11 +502,6 @@ class PEP8Normalizer(Normalizer):
elif leaf in _CLOSING_BRACKETS: elif leaf in _CLOSING_BRACKETS:
message = "Whitespace before '%s'" % leaf.value message = "Whitespace before '%s'" % leaf.value
add_if_spaces(202, message, spacing) add_if_spaces(202, message, spacing)
#elif leaf in _OPENING_BRACKETS:
# TODO
# if False:
# message = "Whitespace before '%s'" % leaf.value
# add_if_spaces(211, message, spacing)
elif leaf in (',', ';') or leaf == ':' \ elif leaf in (',', ';') or leaf == ':' \
and leaf.parent.type not in ('subscript', 'subscriptlist'): and leaf.parent.type not in ('subscript', 'subscriptlist'):
message = "Whitespace before '%s'" % leaf.value message = "Whitespace before '%s'" % leaf.value
@@ -547,13 +542,18 @@ class PEP8Normalizer(Normalizer):
add_not_spaces(275, 'Missing whitespace around keyword', spacing) add_not_spaces(275, 'Missing whitespace around keyword', spacing)
else: else:
prev_spacing = self._previous_spacing prev_spacing = self._previous_spacing
message_225 = 'Missing whitespace between tokens'
if prev in _ALLOW_SPACE and spaces != prev_spacing.value: if prev in _ALLOW_SPACE and spaces != prev_spacing.value:
message = "Whitespace before operator doesn't match with whitespace after" message = "Whitespace before operator doesn't match with whitespace after"
self.add_issue(229, message, spacing) self.add_issue(229, message, spacing)
if spaces and leaf not in _ALLOW_SPACE and prev not in _ALLOW_SPACE: if spaces and leaf not in _ALLOW_SPACE and prev not in _ALLOW_SPACE:
self.add_issue(225, message_225, spacing) message_225 = 'Missing whitespace between tokens'
#print('xy', spacing)
#self.add_issue(225, message_225, spacing)
# TODO why only brackets?
if leaf in _OPENING_BRACKETS:
message = "Whitespace before '%s'" % leaf.value
add_if_spaces(211, message, spacing)
def _analyse_non_prefix(self, leaf): def _analyse_non_prefix(self, leaf):
typ = leaf.type typ = leaf.type

View File

@@ -51,6 +51,6 @@ async def add(a: int = 0, b: int = 0) -> int:
def x(b: tuple = (1, 2))->int: def x(b: tuple = (1, 2))->int:
return a + b return a + b
#: E252:11 E252:12 #: E252:11 E252:12 E231:8
def b(a:int=1): def b(a:int=1):
pass pass