mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Autoformats the query
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user