Skip to content

Commit 86fc9e6

Browse files
authored
Merge pull request github#4650 from RasmusWL/python-set-literal-formatting
Python: Update set literal formatting
2 parents f9d62ad + 9ed1573 commit 86fc9e6

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

python/ql/src/semmle/python/dataflow/new/internal/TaintTrackingPrivate.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,8 @@ predicate containerStep(DataFlow::CfgNode nodeFrom, DataFlow::Node nodeTo) {
173173
// methods
174174
exists(CallNode call, string name | call = nodeTo.asCfgNode() |
175175
name in [
176-
"copy",
177176
// general
178-
"pop",
177+
"copy", "pop",
179178
// dict
180179
"values", "items", "get", "popitem"
181180
] and

python/ql/src/semmle/python/frameworks/Django.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,8 @@ private module Django {
425425
*/
426426
private DataFlow::Node http_attr(DataFlow::TypeTracker t, string attr_name) {
427427
attr_name in [
428-
"request",
429428
// request
430-
"HttpRequest",
429+
"request", "HttpRequest",
431430
// response
432431
"response", "HttpResponse",
433432
// HttpResponse subclasses
@@ -1709,9 +1708,8 @@ private module Django {
17091708
nodeFrom = django::http::request::HttpRequest::instance() and
17101709
exists(DataFlow::AttrRead read | nodeTo = read and read.getObject() = nodeFrom |
17111710
read.getAttributeName() in [
1712-
"body",
17131711
// str / bytes
1714-
"path", "path_info", "method", "encoding", "content_type",
1712+
"body", "path", "path_info", "method", "encoding", "content_type",
17151713
// django.http.QueryDict
17161714
// TODO: Model QueryDict
17171715
"GET", "POST",

python/ql/src/semmle/python/frameworks/Fabric.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ private module FabricV2 {
169169
*/
170170
private DataFlow::Node fabric_attr(DataFlow::TypeTracker t, string attr_name) {
171171
attr_name in [
172-
"connection",
173172
// connection.py
174-
"Connection",
173+
"connection", "Connection",
175174
// group.py
176175
"group", "SerialGroup", "ThreadingGroup",
177176
// tasks.py

python/ql/src/semmle/python/frameworks/Flask.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,10 @@ private module FlaskModel {
389389
this.asCfgNode() = attr and attr.getObject(attr_name) = flask::request().asCfgNode()
390390
|
391391
attr_name in [
392-
"path",
393392
// str
394-
"full_path", "base_url", "url", "access_control_request_method", "content_encoding",
395-
"content_md5", "content_type", "data", "method", "mimetype", "origin", "query_string",
396-
"referrer", "remote_addr", "remote_user", "user_agent",
393+
"path", "full_path", "base_url", "url", "access_control_request_method",
394+
"content_encoding", "content_md5", "content_type", "data", "method", "mimetype",
395+
"origin", "query_string", "referrer", "remote_addr", "remote_user", "user_agent",
397396
// dict
398397
"environ", "cookies", "mimetype_params", "view_args",
399398
// json

python/ql/src/semmle/python/frameworks/Werkzeug.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ module Werkzeug {
116116
nodeFrom = werkzeug::datastructures::FileStorage::instance() and
117117
exists(DataFlow::AttrRead read | nodeTo = read |
118118
read.getAttributeName() in [
119-
"filename",
120119
// str
121-
"name", "content_type", "mimetype",
120+
"filename", "name", "content_type", "mimetype",
122121
// file-like
123122
"stream",
124123
// TODO: werkzeug.datastructures.Headers

0 commit comments

Comments
 (0)