File tree 4 files changed +4
-29
lines changed
4 files changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
170
170
)))
171
171
)
172
172
DUNDER_REGEX = re .compile (r"^__([^\s]+)__(?::\s*[a-zA-Z.0-9_\[\]\"]+)? = " )
173
- MATCH_CASE_REGEX = re .compile (r'^\s*\b(?:match|case)(\s*)(?=.*\:)' )
174
173
BLANK_EXCEPT_REGEX = re .compile (r"except\s*:" )
175
174
176
175
_checks = {'physical_line' : {}, 'logical_line' : {}, 'tree' : {}}
@@ -502,16 +501,6 @@ def whitespace_around_keywords(logical_line):
502
501
elif len (after ) > 1 :
503
502
yield match .start (2 ), "E271 multiple spaces after keyword"
504
503
505
- if sys .version_info >= (3 , 10 ):
506
- match = MATCH_CASE_REGEX .match (logical_line )
507
- if match :
508
- if match [1 ] == ' ' :
509
- return
510
- if match [1 ] == '' :
511
- yield match .start (1 ), "E275 missing whitespace after keyword"
512
- else :
513
- yield match .start (1 ), "E271 multiple spaces after keyword"
514
-
515
504
516
505
@register_check
517
506
def missing_whitespace_after_import_keyword (logical_line ):
Original file line number Diff line number Diff line change 42
42
from importable .module import (e , f )
43
43
except ImportError :
44
44
pass
45
+ #: Okay
46
+ matched = {"true" : True , "false" : False }
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ def foo(x: int) -> int:
9
9
10
10
# Annotated variables #575
11
11
CONST : int = 42
12
+ match : int = 42
13
+ case : int = 42
12
14
13
15
14
16
class Class :
Original file line number Diff line number Diff line change 22
22
pass
23
23
case (0 , 1 , * _):
24
24
pass
25
- #: E271:2:6 E271:3:9 E271:5:9 E271:7:9
26
- var = 1
27
- match var :
28
- case 1 :
29
- pass
30
- case 2 :
31
- pass
32
- case (
33
- 3
34
- ):
35
- pass
36
- #: E275:2:6 E275:3:9 E275:5:9
37
- var = 1
38
- match (var ):
39
- case (1 ):
40
- pass
41
- case_ :
42
- pass
You can’t perform that action at this time.
0 commit comments