Skip to content

Commit acfc62c

Browse files
RasmusWLtausbn
andauthored
Python: Fix grammar
Co-authored-by: Taus <[email protected]>
1 parent 155bbbd commit acfc62c

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

python/ql/test/experimental/library-tests/CallGraph-xfail/call_edge_xfail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def xfail_baz():
1919
else:
2020
func = xfail_bar
2121

22-
# Correct usage to supres bad annotation errors
22+
# Correct usage to suppress bad annotation errors
2323
# calls:xfail_foo calls:xfail_bar
2424
func()
2525
# calls:xfail_lambda

python/ql/test/experimental/library-tests/CallGraph/CallGraphTest.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ private newtype TCallGraphResolver =
8888
TPointsToResolver() or
8989
TTypeTrackerResolver()
9090

91-
/** Describes a method of for call graph resolution */
91+
/** Describes a method of call graph resolution */
9292
abstract class CallGraphResolver extends TCallGraphResolver {
9393
abstract predicate callEdge(Call call, Function callable);
9494

9595
/**
96-
* Annotations show that `call` will call `callable`,
96+
* Holds if annotations show that `call` will call `callable`,
9797
* but our call graph resolver was not able to figure that out
9898
*/
9999
predicate expectedCallEdgeNotFound(Call call, Function callable) {
@@ -102,7 +102,7 @@ abstract class CallGraphResolver extends TCallGraphResolver {
102102
}
103103

104104
/**
105-
* No annotations show that `call` will call `callable` (where at least one of these are annotated),
105+
* Holds if there are no annotations that show that `call` will call `callable` (where at least one of these are annotated),
106106
* but the call graph resolver claims that `call` will call `callable`
107107
*/
108108
predicate unexpectedCallEdgeFound(Call call, Function callable, string message) {
@@ -127,6 +127,7 @@ abstract class CallGraphResolver extends TCallGraphResolver {
127127
string toString() { result = "CallGraphResolver" }
128128
}
129129

130+
/** A call graph resolver based on the existing points-to analysis */
130131
class PointsToResolver extends CallGraphResolver, TPointsToResolver {
131132
override predicate callEdge(Call call, Function callable) {
132133
exists(PythonFunctionValue func_value |
@@ -137,7 +138,7 @@ class PointsToResolver extends CallGraphResolver, TPointsToResolver {
137138

138139
override string toString() { result = "PointsToResolver" }
139140
}
140-
141+
/** A call graph resolved based on Type Trackers */
141142
class TypeTrackerResolver extends CallGraphResolver, TTypeTrackerResolver {
142143
override predicate callEdge(Call call, Function callable) { none() }
143144

python/ql/test/experimental/library-tests/CallGraph/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ foo()
1212

1313
This is greatly inspired by [`CallGraphs/AnnotatedTest`](https://github.com/github/codeql/blob/696d19cb1440b6f6a75c6a2c1319e18860ceb436/javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/Test.ql) from JavaScript.
1414

15-
IMPORTANT: Names used in annotations are not scoped, so must be unique globally. (this is a bit annoying, but makes things simple).
15+
IMPORTANT: Names used in annotations are not scoped, so must be unique globally. (this is a bit annoying, but makes things simple). If multiple identical annotations are used, an error message will be output.
1616

1717
Important files:
1818

@@ -22,11 +22,11 @@ Important files:
2222
- `Relative.ql`: differences between using points-to and TypeTracking.
2323
- `code/` contains the actual Python code we test against (included by `test.py`).
2424

25-
All queries will also execute some `debug_*` predicates, that highlights any obvious problems with the annotation setup, and there should never be any results comitted. To show that this works as expected, see the [CallGraph-xfail](../CallGraph-xfail/) which uses symlinked versions of the files in this directory (can't include as subdir, so has to be a sibling).
25+
All queries will also execute some `debug_*` predicates. These highlight any obvious problems with the annotation setup, and so there should never be any results committed. To show that this works as expected, see the [CallGraph-xfail](../CallGraph-xfail/) which uses symlinked versions of the files in this directory (can't include as subdir, so has to be a sibling).
2626

2727
## `options` file
2828

29-
If the value for `--max-import-depth` is set so `import random` will extract `random.py` from the standard library, BUT NO transitive imports are extracted, then points-to analysis will fail to handle the following snippet.
29+
If the value for `--max-import-depth` is set so that `import random` will extract `random.py` from the standard library, BUT NO transitive imports are extracted, then points-to analysis will fail to handle the following snippet.
3030

3131
```py
3232
import random

0 commit comments

Comments
 (0)