Skip to content

Python: Enable implicit this warnings #13026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/ql/lib/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dependencies:
codeql/yaml: ${workspace}
dataExtensions:
- semmle/python/frameworks/**/model.yml
warnOnImplicitThis: true
1 change: 1 addition & 0 deletions python/ql/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dependencies:
suites: codeql-suites
extractor: python
defaultSuiteFile: codeql-suites/python-code-scanning.qls
warnOnImplicitThis: true
2 changes: 1 addition & 1 deletion python/ql/test/experimental/meta/ConceptsTest.qll
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class HttpServerHttpResponseTest extends InlineExpectationsTest {
location.getFile() = file and
exists(file.getRelativePath()) and
// we need to do this step since we expect subclasses could override getARelevantTag
tag = getARelevantTag() and
tag = this.getARelevantTag() and
(
exists(Http::Server::HttpResponse response |
location = response.getLocation() and
Expand Down
4 changes: 2 additions & 2 deletions python/ql/test/library-tests/ApiGraphs/py2/use.ql
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class ApiUseTest extends InlineExpectationsTest {
}

override predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node n | relevant_node(_, n, location) |
exists(DataFlow::Node n | this.relevant_node(_, n, location) |
tag = "use" and
// Only report the longest path on this line:
value =
max(API::Node a2, Location l2 |
relevant_node(a2, _, l2) and
this.relevant_node(a2, _, l2) and
l2.getFile() = location.getFile() and
l2.getStartLine() = location.getStartLine()
|
Expand Down
1 change: 1 addition & 0 deletions python/ql/test/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dependencies:
codeql/python-queries: ${workspace}
extractor: python
tests: .
warnOnImplicitThis: true
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ModificationOfParameterWithDefaultTest extends InlineExpectationsTest {
}

override predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node n | relevant_node(n) |
exists(DataFlow::Node n | this.relevant_node(n) |
n.getLocation() = location and
tag = "modification" and
value = prettyNode(n) and
Expand Down