Rename files by style guide and change query metadata

This commit is contained in:
alexey
2019-05-29 15:35:58 +01:00
parent 96380f6767
commit 86ec047be2
8 changed files with 28 additions and 19 deletions

View File

@@ -0,0 +1,9 @@
| ReturnOrYieldOutsideFunction_test.py:31:9:31:23 | Return | 'return' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:36:9:36:15 | Yield | 'yield' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:41:9:41:25 | YieldFrom | 'yield from' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:45:5:45:12 | Return | 'return' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:49:5:49:11 | Yield | 'yield' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:53:5:53:16 | YieldFrom | 'yield from' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:57:1:57:14 | YieldFrom | 'yield from' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:60:1:60:12 | Return | 'return' is used outside a function. |
| ReturnOrYieldOutsideFunction_test.py:63:1:63:11 | Yield | 'yield' is used outside a function. |

View File

@@ -0,0 +1 @@
Statements/ReturnOrYieldOutsideFunction.ql

View File

@@ -25,39 +25,39 @@ def valid_func2():
def valid_func3():
yield from [1, 2]
# invalid class with return outside of a function
# invalid class with return outside a function
class InvalidClass1(object):
if [1, 2, 3]:
return "Exists"
# invalid class with yield outside of a function
# invalid class with yield outside a function
class InvalidClass2(object):
while True:
yield 1
# invalid class with yield from outside of a function
# invalid class with yield from outside a function
class InvalidClass3(object):
while True:
yield from [1, 2]
# invalid statement with return outside of a function
# invalid statement with return outside a function
for i in [1, 2, 3]:
return i
# invalid statement with yield outside of a function
# invalid statement with yield outside a function
for i in [1, 2, 3]:
yield i
# invalid statement with yield from outside of a function
# invalid statement with yield from outside a function
for i in [1, 2, 3]:
yield from i
# invalid statement with yield from outside of a function
# invalid statement with yield from outside a function
var = [1,2,3]
yield from var
# invalid statement with return outside of a function
# invalid statement with return outside a function
return False
# invalid statement with yield outside of a function
# invalid statement with yield outside a function
yield False

View File

@@ -1 +0,0 @@
Statements/ReturnOrYieldOutsideOfFunction.ql