mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Autoformats the query
This commit is contained in:
@@ -14,6 +14,13 @@ import python
|
|||||||
import semmle.python.strings
|
import semmle.python.strings
|
||||||
|
|
||||||
from Expr e, ClassValue t
|
from Expr e, ClassValue t
|
||||||
where exists(BinaryExpr b | b.getOp() instanceof Mod and format_string(b.getLeft()) and e = b.getRight() and
|
where
|
||||||
mapping_format(b.getLeft()) and e.pointsTo().getClass() = t and not t.isMapping())
|
exists(BinaryExpr b |
|
||||||
select e, "Right hand side of a % operator must be a mapping, not class $@.", t, t.getName()
|
b.getOp() instanceof Mod and
|
||||||
|
format_string(b.getLeft()) and
|
||||||
|
e = b.getRight() and
|
||||||
|
mapping_format(b.getLeft()) and
|
||||||
|
e.pointsTo().getClass() = t and
|
||||||
|
not t.isMapping()
|
||||||
|
)
|
||||||
|
select e, "Right hand side of a % operator must be a mapping, not class $@.", t, t.getName()
|
||||||
|
|||||||
Reference in New Issue
Block a user