Autoformats the query

This commit is contained in:
Rebecca Valentine
2020-02-18 11:43:31 -08:00
parent acb3c524dd
commit 4059a99da6

View File

@@ -14,6 +14,13 @@ import python
import semmle.python.strings
from Expr e, ClassValue t
where exists(BinaryExpr b | 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()
where
exists(BinaryExpr b |
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()