Python: Autoformat everything

Of course, `StringLiteral` being much longer than `StrConst` meant a
bunch of files changed formatting.
This commit is contained in:
Taus
2024-04-17 16:09:45 +00:00
parent 1c68c987b0
commit b484aee39e
10 changed files with 56 additions and 18 deletions

View File

@@ -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" |

View File

@@ -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
)
}

View File

@@ -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()
)
}

View File

@@ -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