Skip to content

Commit 3491d90

Browse files
committed
Python: Apply auto-format.
1 parent 1385f3c commit 3491d90

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

python/ql/src/Expressions/ContainsNonContainer.ql

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ import semmle.python.pointsto.PointsTo
1515

1616
predicate rhs_in_expr(ControlFlowNode rhs, Compare cmp) {
1717
exists(Cmpop op, int i | cmp.getOp(i) = op and cmp.getComparator(i) = rhs.getNode() |
18-
op instanceof In or op instanceof NotIn
18+
op instanceof In or op instanceof NotIn
1919
)
2020
}
2121

2222
from ControlFlowNode non_seq, Compare cmp, Value v, ClassValue cls, ControlFlowNode origin
23-
where rhs_in_expr(non_seq, cmp) and
24-
non_seq.pointsTo(_, v, origin) and
25-
v.getClass() = cls and
26-
not Types::failedInference(cls, _) and
27-
not cls.hasAttribute("__contains__") and
28-
not cls.hasAttribute("__iter__") and
29-
not cls.hasAttribute("__getitem__") and
30-
not cls = ClassValue::nonetype() and
31-
not cls = Value::named("types.MappingProxyType")
32-
33-
select cmp, "This test may raise an Exception as the $@ may be of non-container class $@.", origin, "target", cls, cls.getName()
23+
where
24+
rhs_in_expr(non_seq, cmp) and
25+
non_seq.pointsTo(_, v, origin) and
26+
v.getClass() = cls and
27+
not Types::failedInference(cls, _) and
28+
not cls.hasAttribute("__contains__") and
29+
not cls.hasAttribute("__iter__") and
30+
not cls.hasAttribute("__getitem__") and
31+
not cls = ClassValue::nonetype() and
32+
not cls = Value::named("types.MappingProxyType")
33+
select cmp, "This test may raise an Exception as the $@ may be of non-container class $@.", origin,
34+
"target", cls, cls.getName()

0 commit comments

Comments
 (0)