Merge pull request #4650 from RasmusWL/python-set-literal-formatting

Python: Update set literal formatting
This commit is contained in:
yoff
2020-11-11 15:35:12 +01:00
committed by GitHub
5 changed files with 8 additions and 14 deletions

View File

@@ -173,9 +173,8 @@ predicate containerStep(DataFlow::CfgNode nodeFrom, DataFlow::Node nodeTo) {
// methods
exists(CallNode call, string name | call = nodeTo.asCfgNode() |
name in [
"copy",
// general
"pop",
"copy", "pop",
// dict
"values", "items", "get", "popitem"
] and

View File

@@ -425,9 +425,8 @@ private module Django {
*/
private DataFlow::Node http_attr(DataFlow::TypeTracker t, string attr_name) {
attr_name in [
"request",
// request
"HttpRequest",
"request", "HttpRequest",
// response
"response", "HttpResponse",
// HttpResponse subclasses
@@ -1709,9 +1708,8 @@ private module Django {
nodeFrom = django::http::request::HttpRequest::instance() and
exists(DataFlow::AttrRead read | nodeTo = read and read.getObject() = nodeFrom |
read.getAttributeName() in [
"body",
// str / bytes
"path", "path_info", "method", "encoding", "content_type",
"body", "path", "path_info", "method", "encoding", "content_type",
// django.http.QueryDict
// TODO: Model QueryDict
"GET", "POST",

View File

@@ -169,9 +169,8 @@ private module FabricV2 {
*/
private DataFlow::Node fabric_attr(DataFlow::TypeTracker t, string attr_name) {
attr_name in [
"connection",
// connection.py
"Connection",
"connection", "Connection",
// group.py
"group", "SerialGroup", "ThreadingGroup",
// tasks.py

View File

@@ -389,11 +389,10 @@ private module FlaskModel {
this.asCfgNode() = attr and attr.getObject(attr_name) = flask::request().asCfgNode()
|
attr_name in [
"path",
// str
"full_path", "base_url", "url", "access_control_request_method", "content_encoding",
"content_md5", "content_type", "data", "method", "mimetype", "origin", "query_string",
"referrer", "remote_addr", "remote_user", "user_agent",
"path", "full_path", "base_url", "url", "access_control_request_method",
"content_encoding", "content_md5", "content_type", "data", "method", "mimetype",
"origin", "query_string", "referrer", "remote_addr", "remote_user", "user_agent",
// dict
"environ", "cookies", "mimetype_params", "view_args",
// json

View File

@@ -116,9 +116,8 @@ module Werkzeug {
nodeFrom = werkzeug::datastructures::FileStorage::instance() and
exists(DataFlow::AttrRead read | nodeTo = read |
read.getAttributeName() in [
"filename",
// str
"name", "content_type", "mimetype",
"filename", "name", "content_type", "mimetype",
// file-like
"stream",
// TODO: werkzeug.datastructures.Headers