File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,10 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
132
132
OPERATOR_REGEX = re .compile (r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)' )
133
133
LAMBDA_REGEX = re .compile (r'\blambda\b' )
134
134
HUNK_REGEX = re .compile (r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$' )
135
- STARTSWITH_DEF_REGEX = re .compile (r'^(async\s+def|def)' )
135
+ STARTSWITH_DEF_REGEX = re .compile (r'^(async\s+def|def)\b ' )
136
136
STARTSWITH_TOP_LEVEL_REGEX = re .compile (r'^(async\s+def\s+|def\s+|class\s+|@)' )
137
137
STARTSWITH_INDENT_STATEMENT_REGEX = re .compile (
138
- r'^\s*({0})' .format ('|' .join (s .replace (' ' , r'\s+' ) for s in (
138
+ r'^\s*({0})\b ' .format ('|' .join (s .replace (' ' , r'\s+' ) for s in (
139
139
'def' , 'async def' ,
140
140
'for' , 'async for' ,
141
141
'if' , 'elif' , 'else' ,
Original file line number Diff line number Diff line change @@ -12,7 +12,28 @@ def foo(x: int) -> int:
12
12
13
13
14
14
class Class :
15
+ # Camel-caes
15
16
cls_var : ClassVar [str ]
17
+ for_var : ClassVar [str ]
18
+ while_var : ClassVar [str ]
19
+ def_var : ClassVar [str ]
20
+ if_var : ClassVar [str ]
21
+ elif_var : ClassVar [str ]
22
+ else_var : ClassVar [str ]
23
+ try_var : ClassVar [str ]
24
+ except_var : ClassVar [str ]
25
+ finally_var : ClassVar [str ]
26
+ with_var : ClassVar [str ]
27
+ forVar : ClassVar [str ]
28
+ whileVar : ClassVar [str ]
29
+ defVar : ClassVar [str ]
30
+ ifVar : ClassVar [str ]
31
+ elifVar : ClassVar [str ]
32
+ elseVar : ClassVar [str ]
33
+ tryVar : ClassVar [str ]
34
+ exceptVar : ClassVar [str ]
35
+ finallyVar : ClassVar [str ]
36
+ withVar : ClassVar [str ]
16
37
17
38
def m (self ):
18
39
xs : List [int ] = []
You can’t perform that action at this time.
0 commit comments