mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Python: tests with false positives around match
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
| functions_test.py:18:1:18:11 | Function cr1 | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |
|
||||
| functions_test.py:22:1:22:11 | Function cr2 | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |
|
||||
| functions_test.py:336:1:336:16 | Function ok_match | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |
|
||||
|
||||
@@ -330,4 +330,12 @@ def indirectly_returning_different_tuple_sizes(x):
|
||||
|
||||
def mismatched_multi_assign(x):
|
||||
a,b = returning_different_tuple_sizes(x)
|
||||
return a,b
|
||||
return a,b
|
||||
|
||||
|
||||
def ok_match(x): # FP
|
||||
match x:
|
||||
case True | 'true':
|
||||
return 0
|
||||
case _:
|
||||
raise ValueError(x)
|
||||
|
||||
Reference in New Issue
Block a user