diff options
author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2020-05-08 09:26:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 09:26:05 -0500 |
commit | 1aa4c0a337d946388eab0c7f24eeb56908bf7252 (patch) | |
tree | 510d6cec052fbb8daf2621f64f630055738de4da /pycodestyle.py | |
parent | 90026afea11298f0450194ed44af0b659ff6fc91 (diff) | |
parent | 39895aae46a2a4b665fc85a3747f2fafd27441fa (diff) | |
download | pep8-1aa4c0a337d946388eab0c7f24eeb56908bf7252.tar.gz |
Merge pull request #931 from suzil/fix/767/chained-is-not-E714
E714: fix chained `is not`
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-x | pycodestyle.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 7198639..651edfb 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -140,7 +140,8 @@ EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({] | [\]}),;]| :(?!=)') WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') COMPARE_SINGLETON_REGEX = re.compile(r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)' r'\s*(?(1)|(None|False|True))\b') -COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s') +COMPARE_NEGATIVE_REGEX = re.compile(r'\b(?<!is\s)(not)\s+[^][)(}{ ]+\s+' + r'(in|is)\s') COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s+type(?:s.\w+Type' r'|\s*\(\s*([^)]*[^ )])\s*\))') KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) |