mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-20 19:31:18 +08:00
Get all tests passing except those E12* tests.
You can reproduce this with "pytest -k 'not E12'".
This commit is contained in:
@@ -502,11 +502,6 @@ class PEP8Normalizer(Normalizer):
|
||||
elif leaf in _CLOSING_BRACKETS:
|
||||
message = "Whitespace before '%s'" % leaf.value
|
||||
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 == ':' \
|
||||
and leaf.parent.type not in ('subscript', 'subscriptlist'):
|
||||
message = "Whitespace before '%s'" % leaf.value
|
||||
@@ -547,13 +542,18 @@ class PEP8Normalizer(Normalizer):
|
||||
add_not_spaces(275, 'Missing whitespace around keyword', spacing)
|
||||
else:
|
||||
prev_spacing = self._previous_spacing
|
||||
message_225 = 'Missing whitespace between tokens'
|
||||
if prev in _ALLOW_SPACE and spaces != prev_spacing.value:
|
||||
message = "Whitespace before operator doesn't match with whitespace after"
|
||||
self.add_issue(229, message, spacing)
|
||||
|
||||
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):
|
||||
typ = leaf.type
|
||||
|
||||
@@ -51,6 +51,6 @@ async def add(a: int = 0, b: int = 0) -> int:
|
||||
def x(b: tuple = (1, 2))->int:
|
||||
return a + b
|
||||
|
||||
#: E252:11 E252:12
|
||||
#: E252:11 E252:12 E231:8
|
||||
def b(a:int=1):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user