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.
132132OPERATOR_REGEX = re .compile (r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)' )
133133LAMBDA_REGEX = re .compile (r'\blambda\b' )
134134HUNK_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 ' )
136136STARTSWITH_TOP_LEVEL_REGEX = re .compile (r'^(async\s+def\s+|def\s+|class\s+|@)' )
137137STARTSWITH_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 (
139139 'def' , 'async def' ,
140140 'for' , 'async for' ,
141141 'if' , 'elif' , 'else' ,
Original file line number Diff line number Diff line change @@ -12,7 +12,28 @@ def foo(x: int) -> int:
1212
1313
1414class Class :
15+ # Camel-caes
1516 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 ]
1637
1738 def m (self ):
1839 xs : List [int ] = []
You can’t perform that action at this time.
0 commit comments