Skip to content

Commit 063a8bb

Browse files
tausbnyoff
andauthored
Python: Apply suggestions from code review
Co-authored-by: yoff <lerchedahl@gmail.com>
1 parent 5a8ba6a commit 063a8bb

File tree

12 files changed

+31
-24
lines changed

12 files changed

+31
-24
lines changed

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds if there is an optional result on the specified location.
128+
*
129+
* This is similar to `hasActualResult`, but returns results that do not require a matching annotation.
128130
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129131
* Override this predicate to specify optional results.
130132
*/

csharp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds if there is an optional result on the specified location.
128+
*
129+
* This is similar to `hasActualResult`, but returns results that do not require a matching annotation.
128130
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129131
* Override this predicate to specify optional results.
130132
*/

java/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds if there is an optional result on the specified location.
128+
*
129+
* This is similar to `hasActualResult`, but returns results that do not require a matching annotation.
128130
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129131
* Override this predicate to specify optional results.
130132
*/

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ import IterableUnpacking
16191619
*/
16201620
module MatchUnpacking {
16211621
/**
1622-
* Holds when there is flow from the subject `nodeFrom` to the case `nodeTo` of a `match` statement.
1622+
* Holds when there is flow from the subject `nodeFrom` to the (top-level) pattern `nodeTo` of a `match` statement.
16231623
*
16241624
* The subject of a match flows to each top-level pattern
16251625
* (a pattern directly under a `case` statement).

python/ql/lib/semmle/python/frameworks/Aiomysql.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ private module Aiomysql {
1515
private import semmle.python.internal.Awaited
1616

1717
/**
18-
* Gets the `ConnectionPool` that is created when the result of `aiomysql.create_pool()` is awaited.
18+
* Gets a `ConnectionPool` that is created when the result of `aiomysql.create_pool()` is awaited.
1919
* See https://aiomysql.readthedocs.io/en/stable/pool.html
2020
*/
2121
API::Node connectionPool() {
2222
result = API::moduleImport("aiomysql").getMember("create_pool").getReturn().getAwaited()
2323
}
2424

2525
/**
26-
* Gets the `Connection` that is created when
26+
* Gets a `Connection` that is created when
2727
* - the result of `aiomysql.connect()` is awaited.
2828
* - the result of calling `aquire` on a `ConnectionPool` is awaited.
2929
* See https://aiomysql.readthedocs.io/en/stable/connection.html#connection
@@ -35,7 +35,7 @@ private module Aiomysql {
3535
}
3636

3737
/**
38-
* Gets the `Cursor` that is created when
38+
* Gets a `Cursor` that is created when
3939
* - the result of calling `cursor` on a `ConnectionPool` is awaited.
4040
* - the result of calling `cursor` on a `Connection` is awaited.
4141
* See https://aiomysql.readthedocs.io/en/stable/cursors.html
@@ -85,7 +85,7 @@ private module Aiomysql {
8585
}
8686

8787
/**
88-
* Gets the `Engine` that is created when the result of calling `aiomysql.sa.create_engine` is awaited.
88+
* Gets an `Engine` that is created when the result of calling `aiomysql.sa.create_engine` is awaited.
8989
* See https://aiomysql.readthedocs.io/en/stable/sa.html#engine
9090
*/
9191
API::Node engine() {
@@ -98,7 +98,7 @@ private module Aiomysql {
9898
}
9999

100100
/**
101-
* Gets the `SAConnection` that is created when the result of calling `aquire` on an `Engine` is awaited.
101+
* Gets an `SAConnection` that is created when the result of calling `aquire` on an `Engine` is awaited.
102102
* See https://aiomysql.readthedocs.io/en/stable/sa.html#connection
103103
*/
104104
API::Node saConnection() { result = engine().getMember("acquire").getReturn().getAwaited() }

python/ql/lib/semmle/python/frameworks/Aiopg.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ private module Aiopg {
1515
private import semmle.python.internal.Awaited
1616

1717
/**
18-
* Gets the `ConnectionPool` that is created when the result of `aiopg.create_pool()` is awaited.
18+
* Gets a `ConnectionPool` that is created when the result of `aiopg.create_pool()` is awaited.
1919
* See https://aiopg.readthedocs.io/en/stable/core.html#pool
2020
*/
2121
API::Node connectionPool() {
2222
result = API::moduleImport("aiopg").getMember("create_pool").getReturn().getAwaited()
2323
}
2424

2525
/**
26-
* Gets the `Connection` that is created when
26+
* Gets a `Connection` that is created when
2727
* - the result of `aiopg.connect()` is awaited.
2828
* - the result of calling `aquire` on a `ConnectionPool` is awaited.
2929
* See https://aiopg.readthedocs.io/en/stable/core.html#connection
@@ -35,7 +35,7 @@ private module Aiopg {
3535
}
3636

3737
/**
38-
* Gets the `Cursor` that is created when
38+
* Gets a `Cursor` that is created when
3939
* - the result of calling `cursor` on a `ConnectionPool` is awaited.
4040
* - the result of calling `cursor` on a `Connection` is awaited.
4141
* See https://aiopg.readthedocs.io/en/stable/core.html#cursor
@@ -85,7 +85,7 @@ private module Aiopg {
8585
}
8686

8787
/**
88-
* Gets the `Engine` that is created when the result of calling `aiopg.sa.create_engine` is awaited.
88+
* Gets an `Engine` that is created when the result of calling `aiopg.sa.create_engine` is awaited.
8989
* See https://aiopg.readthedocs.io/en/stable/sa.html#engine
9090
*/
9191
API::Node engine() {
@@ -94,7 +94,7 @@ private module Aiopg {
9494
}
9595

9696
/**
97-
* Gets the `SAConnection` that is created when the result of calling `aquire` on an `Engine` is awaited.
97+
* Gets an `SAConnection` that is created when the result of calling `aquire` on an `Engine` is awaited.
9898
* See https://aiopg.readthedocs.io/en/stable/sa.html#connection
9999
*/
100100
API::Node saConnection() { result = engine().getMember("acquire").getReturn().getAwaited() }

python/ql/lib/semmle/python/frameworks/Asyncpg.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ private import semmle.python.ApiGraphs
1212
private module Asyncpg {
1313
private import semmle.python.internal.Awaited
1414

15-
/** Gets the `ConnectionPool` that is created when the result of `asyncpg.create_pool()` is awaited. */
15+
/** Gets a `ConnectionPool` that is created when the result of `asyncpg.create_pool()` is awaited. */
1616
API::Node connectionPool() {
1717
result = API::moduleImport("asyncpg").getMember("create_pool").getReturn().getAwaited()
1818
}
1919

2020
/**
21-
* Gets the `Connection` that is created when
21+
* Gets a `Connection` that is created when
2222
* - the result of `asyncpg.connect()` is awaited.
2323
* - the result of calling `aquire` on a `ConnectionPool` is awaited.
2424
*/

python/ql/lib/semmle/python/types/ClassObject.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ ClassObject theBuiltinFunctionType() {
447447
/** Gets the class of Python functions */
448448
ClassObject thePyFunctionType() { result.asBuiltin() = Builtin::special("FunctionType") }
449449

450-
/** Gets thGets the builtin class 'classmethod' */
450+
/** Gets the builtin class 'classmethod' */
451451
ClassObject theClassMethodType() { result.asBuiltin() = Builtin::special("ClassMethod") }
452452

453453
/** Gets the builtin class 'staticmethod' */

python/ql/src/Imports/DeprecatedModule.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
import python
1414

1515
/**
16-
* Gets the name of a deprecated module (for a particular version of Python) and the name of a suggested
17-
* replacement.
18-
*
19-
* The module `name` was deprecated in Python version `major`.`minor`,
16+
* Holds if the module `name` was deprecated in Python version `major`.`minor`,
2017
* and module `instead` should be used instead (or `instead = "no replacement"`)
2118
*/
2219
predicate deprecated_module(string name, string instead, int major, int minor) {

python/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ abstract class InlineExpectationsTest extends string {
124124
abstract predicate hasActualResult(Location location, string element, string tag, string value);
125125

126126
/**
127-
* Holds similarly to `hasActualResult`, but returns results that do not require a matching annotation.
127+
* Holds if there is an optional result on the specified location.
128+
*
129+
* This is similar to `hasActualResult`, but returns results that do not require a matching annotation.
128130
* A failure will still arise if there is an annotation that does not match any results, but not vice versa.
129131
* Override this predicate to specify optional results.
130132
*/

0 commit comments

Comments
 (0)