Skip to content

Commit df9fb14

Browse files
committed
Python: Remove old manual consistency query tests
1 parent b6df6b7 commit df9fb14

File tree

50 files changed

+24
-761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+24
-761
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
import python
1+
/**
2+
* Provides consistency queries for checking invariants in the language-specific
3+
* data-flow classes and predicates.
4+
*/
5+
6+
private import python
27
import semmle.python.dataflow.new.DataFlow::DataFlow
3-
import semmle.python.dataflow.new.internal.DataFlowPrivate
4-
import semmle.python.dataflow.new.internal.DataFlowImplConsistency::Consistency
8+
private import semmle.python.dataflow.new.internal.DataFlowImplSpecific
9+
private import semmle.python.dataflow.new.internal.TaintTrackingImplSpecific
10+
private import codeql.dataflow.internal.DataFlowImplConsistency
11+
12+
private module Input implements InputSig<PythonDataFlow> {
13+
private import Private
14+
private import Public
515

6-
private class MyConsistencyConfiguration extends ConsistencyConfiguration {
7-
override predicate argHasPostUpdateExclude(ArgumentNode n) {
16+
predicate argHasPostUpdateExclude(ArgumentNode n) {
817
exists(ArgumentPosition apos | n.argumentOf(_, apos) and apos.isStarArgs(_))
918
or
1019
exists(ArgumentPosition apos | n.argumentOf(_, apos) and apos.isDictSplat())
1120
}
1221

13-
override predicate reverseReadExclude(Node n) {
22+
predicate reverseReadExclude(Node n) {
1423
// since `self`/`cls` parameters can be marked as implicit argument to `super()`,
1524
// they will have PostUpdateNodes. We have a read-step from the synthetic `**kwargs`
1625
// parameter, but dataflow-consistency queries should _not_ complain about there not
1726
// being a post-update node for the synthetic `**kwargs` parameter.
1827
n instanceof SynthDictSplatParameterNode
1928
}
2029

21-
override predicate uniqueParameterNodePositionExclude(
22-
DataFlowCallable c, ParameterPosition pos, Node p
23-
) {
30+
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
2431
// For normal parameters that can both be passed as positional arguments or keyword
2532
// arguments, we currently have parameter positions for both cases..
2633
//
@@ -34,11 +41,17 @@ private class MyConsistencyConfiguration extends ConsistencyConfiguration {
3441
)
3542
}
3643

37-
override predicate uniqueCallEnclosingCallableExclude(DataFlowCall call) {
44+
predicate uniqueCallEnclosingCallableExclude(DataFlowCall call) {
3845
not exists(call.getLocation().getFile().getRelativePath())
3946
}
4047

41-
override predicate identityLocalStepExclude(Node n) {
48+
predicate identityLocalStepExclude(Node n) {
4249
not exists(n.getLocation().getFile().getRelativePath())
4350
}
51+
52+
predicate multipleArgumentCallExclude(ArgumentNode arg, DataFlowCall call) {
53+
isArgumentNode(arg, call, _)
54+
}
4455
}
56+
57+
import MakeConsistency<PythonDataFlow, PythonTaintTracking, Input>

python/ql/test/experimental/dataflow/TestUtil/DataFlowConsistency.qll

Lines changed: 0 additions & 6 deletions
This file was deleted.

python/ql/test/experimental/dataflow/basic/dataflow-consistency.expected

Lines changed: 0 additions & 27 deletions
This file was deleted.

python/ql/test/experimental/dataflow/basic/dataflow-consistency.ql

Lines changed: 0 additions & 2 deletions
This file was deleted.

python/ql/test/experimental/dataflow/callgraph_crosstalk/dataflow-consistency.expected

Lines changed: 0 additions & 27 deletions
This file was deleted.

python/ql/test/experimental/dataflow/callgraph_crosstalk/dataflow-consistency.ql

Lines changed: 0 additions & 2 deletions
This file was deleted.

python/ql/test/experimental/dataflow/calls/dataflow-consistency.expected

Lines changed: 0 additions & 27 deletions
This file was deleted.

python/ql/test/experimental/dataflow/calls/dataflow-consistency.ql

Lines changed: 0 additions & 2 deletions
This file was deleted.

python/ql/test/experimental/dataflow/consistency/dataflow-consistency.expected

Lines changed: 0 additions & 27 deletions
This file was deleted.

python/ql/test/experimental/dataflow/consistency/dataflow-consistency.ql

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)