mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Python: Autoformat everything
Of course, `StringLiteral` being much longer than `StrConst` meant a bunch of files changed formatting.
This commit is contained in:
@@ -612,7 +612,8 @@ newtype TContent =
|
||||
key = any(Keyword kw).getArg()
|
||||
or
|
||||
// d["key"] = ...
|
||||
key = any(SubscriptNode sub | sub.isStore() | sub.getIndex().getNode().(StringLiteral).getText())
|
||||
key =
|
||||
any(SubscriptNode sub | sub.isStore() | sub.getIndex().getNode().(StringLiteral).getText())
|
||||
or
|
||||
// d.setdefault("key", ...)
|
||||
exists(CallNode call | call.getFunction().(AttrNode).getName() = "setdefault" |
|
||||
|
||||
@@ -2908,7 +2908,8 @@ module StdlibPrivate {
|
||||
exists(string algorithmName | result.matchesName(algorithmName) |
|
||||
this.getDigestArg().asSink() = hashlibMember(algorithmName).asSource()
|
||||
or
|
||||
this.getDigestArg().getAValueReachingSink().asExpr().(StringLiteral).getText() = algorithmName
|
||||
this.getDigestArg().getAValueReachingSink().asExpr().(StringLiteral).getText() =
|
||||
algorithmName
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,8 @@ module Impl implements RegexTreeViewSig {
|
||||
index > 0 and
|
||||
exists(int previousOffset | previousOffset = this.getPartOffset(index - 1) |
|
||||
result =
|
||||
previousOffset + re.(StringLiteral).getImplicitlyConcatenatedPart(index - 1).getContentLength()
|
||||
previousOffset +
|
||||
re.(StringLiteral).getImplicitlyConcatenatedPart(index - 1).getContentLength()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,9 @@ module ServerSideRequestForgery {
|
||||
exists(BinaryExprNode add |
|
||||
add.getOp() instanceof Add and
|
||||
add.getRight() = this.asCfgNode() and
|
||||
not add.getLeft().getNode().(StringLiteral).getText().toLowerCase() in ["http://", "https://"]
|
||||
not add.getLeft().getNode().(StringLiteral).getText().toLowerCase() in [
|
||||
"http://", "https://"
|
||||
]
|
||||
)
|
||||
or
|
||||
// % formatting
|
||||
|
||||
Reference in New Issue
Block a user