Skip to content

Commit a9674ef

Browse files
committed
Python: Resolve autoformat ugliness
1 parent 4f3149d commit a9674ef

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

python/ql/src/Statements/StatementNoEffect.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ predicate maybe_side_effecting_attribute(Attribute attr) {
3636

3737
predicate side_effecting_descriptor_type(ClassValue descriptor) {
3838
descriptor.isDescriptorType() and
39-
/*
40-
* Technically all descriptor gets have side effects,
41-
* but some are indicative of a missing call and
42-
* we want to treat them as having no effect.
43-
*/
44-
39+
// Technically all descriptor gets have side effects,
40+
// but some are indicative of a missing call and
41+
// we want to treat them as having no effect.
4542
not descriptor = ClassValue::functionType() and
4643
not descriptor = ClassValue::staticmethod() and
4744
not descriptor = ClassValue::classmethod()

python/ql/src/Statements/UnnecessaryDelete.ql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ where
2222
not e instanceof Subscript and
2323
not e instanceof Attribute and
2424
not exists(Stmt s | s.(While).contains(del) or s.(For).contains(del)) and
25-
/*
26-
* False positive: calling `sys.exc_info` within a function results in a
27-
* reference cycle, and an explicit call to `del` helps break this cycle.
28-
*/
29-
25+
// False positive: calling `sys.exc_info` within a function results in a
26+
// reference cycle, and an explicit call to `del` helps break this cycle.
3027
not exists(FunctionValue ex |
3128
ex = Value::named("sys.exc_info") and
3229
ex.getACall().getScope() = f

0 commit comments

Comments
 (0)