Skip to content

Commit b54d95d

Browse files
authored
Merge pull request #21967 from github/copilot/conversion-of-codeql-queries
Convert selected Python qlref tests to inline expectations
2 parents a076ffc + 27f6ffc commit b54d95d

339 files changed

Lines changed: 1387 additions & 1227 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Classes/PropertyInOldStyleClass.ql
1+
query: Classes/PropertyInOldStyleClass.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Classes/SlotsInOldStyleClass.ql
1+
query: Classes/SlotsInOldStyleClass.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Classes/SuperInOldStyleClass.ql
1+
query: Classes/SuperInOldStyleClass.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

python/ql/test/2/query-tests/Classes/new-style/newstyle_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#Only works for Python2
33

4-
class OldStyle1:
4+
class OldStyle1: # $ Alert[py/slots-in-old-style-class]
55

66
__slots__ = [ 'a', 'b' ]
77

@@ -12,7 +12,7 @@ def __init__(self, a, b):
1212
class OldStyle2:
1313

1414
def __init__(self, x):
15-
super().__init__(x)
15+
super().__init__(x) # $ Alert[py/super-in-old-style]
1616

1717
class NewStyle1(object):
1818

python/ql/test/2/query-tests/Classes/new-style/property_old_style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ class OldStyle:
55
def __init__(self, x):
66
self._x = x
77

8-
@property
8+
@property # $ Alert[py/property-in-old-style-class]
99
def piosc(self):
1010
return self._x
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Exceptions/CatchingBaseException.ql
1+
query: Exceptions/CatchingBaseException.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Exceptions/EmptyExcept.ql
1+
query: Exceptions/EmptyExcept.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Exceptions/IncorrectExceptOrder.ql
1+
query: Exceptions/IncorrectExceptOrder.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Exceptions/UnguardedNextInGenerator.ql
1+
query: Exceptions/UnguardedNextInGenerator.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

python/ql/test/2/query-tests/Exceptions/generators/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
def bad1(it):
44
while True:
5-
yield next(it)
5+
yield next(it) # $ Alert
66

77
def bad2(seq):
88
it = iter(seq)
99
#Not OK as seq may be empty
10-
raise KeyError(next(it))
10+
raise KeyError(next(it)) # $ Alert
1111
yield 0
1212

1313
def ok1(seq):

0 commit comments

Comments
 (0)