Skip to content

Commit f2031e4

Browse files
authored
Merge pull request github#13026 from kaspersv/kaspersv/python-enable-warn-on-implicit-this
Python: Enable implicit this warnings
2 parents 3d0935a + d9f29a8 commit f2031e4

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

python/ql/lib/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ dependencies:
1212
codeql/yaml: ${workspace}
1313
dataExtensions:
1414
- semmle/python/frameworks/**/model.yml
15+
warnOnImplicitThis: true

python/ql/src/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ dependencies:
99
suites: codeql-suites
1010
extractor: python
1111
defaultSuiteFile: codeql-suites/python-code-scanning.qls
12+
warnOnImplicitThis: true

python/ql/test/experimental/meta/ConceptsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class HttpServerHttpResponseTest extends InlineExpectationsTest {
297297
location.getFile() = file and
298298
exists(file.getRelativePath()) and
299299
// we need to do this step since we expect subclasses could override getARelevantTag
300-
tag = getARelevantTag() and
300+
tag = this.getARelevantTag() and
301301
(
302302
exists(Http::Server::HttpResponse response |
303303
location = response.getLocation() and

python/ql/test/library-tests/ApiGraphs/py2/use.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class ApiUseTest extends InlineExpectationsTest {
1313
}
1414

1515
override predicate hasActualResult(Location location, string element, string tag, string value) {
16-
exists(DataFlow::Node n | relevant_node(_, n, location) |
16+
exists(DataFlow::Node n | this.relevant_node(_, n, location) |
1717
tag = "use" and
1818
// Only report the longest path on this line:
1919
value =
2020
max(API::Node a2, Location l2 |
21-
relevant_node(a2, _, l2) and
21+
this.relevant_node(a2, _, l2) and
2222
l2.getFile() = location.getFile() and
2323
l2.getStartLine() = location.getStartLine()
2424
|

python/ql/test/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dependencies:
55
codeql/python-queries: ${workspace}
66
extractor: python
77
tests: .
8+
warnOnImplicitThis: true

python/ql/test/query-tests/Functions/ModificationOfParameterWithDefault/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ModificationOfParameterWithDefaultTest extends InlineExpectationsTest {
1414
}
1515

1616
override predicate hasActualResult(Location location, string element, string tag, string value) {
17-
exists(DataFlow::Node n | relevant_node(n) |
17+
exists(DataFlow::Node n | this.relevant_node(n) |
1818
n.getLocation() = location and
1919
tag = "modification" and
2020
value = prettyNode(n) and

0 commit comments

Comments
 (0)