summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRach Belaid <rachid.belaid@gmail.com>2017-03-22 22:55:40 -0700
committerGitHub <noreply@github.com>2017-03-22 22:55:40 -0700
commit27ed964c2fc3340d145e9f602400af2f6d039350 (patch)
treea977d7e4f3ef2ab1477ffe69490619621ff543ec
parentf1908ba99b72c272720de067794cd3d1a88a1bbb (diff)
downloadpep8-27ed964c2fc3340d145e9f602400af2f6d039350.tar.gz
Support variable annotation when variable start by a keyword
Support case when the variable name start by a keyword, eg: ``` class Test: formula: str = None ```
-rwxr-xr-xpycodestyle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 5d8c2ac..ff6f0cc 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -124,7 +124,7 @@ HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$')
STARTSWITH_DEF_REGEX = re.compile(r'^(async\s+def|def)')
STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def\s+|def\s+|class\s+|@)')
STARTSWITH_INDENT_STATEMENT_REGEX = re.compile(
- r'^\s*({0})'.format('|'.join(s.replace(' ', '\s+') for s in (
+ r'^\s*({0})\s'.format('|'.join(s.replace(' ', '\s+') for s in (
'def', 'async def',
'for', 'async for',
'if', 'elif', 'else',