Skip to content

Commit 66c2de8

Browse files
authored
Merge pull request github#10729 from erik-krogh/py-last-msg
Py: fix some more style-guide violations in the alert-messages
2 parents 0883b17 + a826dbb commit 66c2de8

File tree

114 files changed

+447
-438
lines changed

Some content is hidden

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

114 files changed

+447
-438
lines changed

python/ql/src/Classes/MaybeUndefinedClassAttribute.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ where
3939
sa.getName() = a.getName()
4040
select a,
4141
"Attribute '" + a.getName() +
42-
"' is not defined in the class body nor in the __init__() method, but it is defined $@", sa,
42+
"' is not defined in the class body nor in the __init__() method, but it is defined $@.", sa,
4343
"here"

python/ql/src/Classes/SlotsInOldStyleClass.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ import python
1515

1616
from ClassObject c
1717
where not c.isNewStyle() and c.declaresAttribute("__slots__") and not c.failedInference()
18-
select c, "Using __slots__ in an old style class just creates a class attribute called '__slots__'"
18+
select c,
19+
"Using '__slots__' in an old style class just creates a class attribute called '__slots__'."

python/ql/src/Classes/SubclassShadowing.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ predicate shadowed_by_super_class(
4242
from ClassObject c, ClassObject supercls, Assign assign, FunctionObject shadowed
4343
where shadowed_by_super_class(c, supercls, assign, shadowed)
4444
select shadowed.getOrigin(),
45-
"Method " + shadowed.getName() + " is shadowed by $@ in super class '" + supercls.getName() + "'.",
46-
assign, "an attribute"
45+
"Method " + shadowed.getName() + " is shadowed by an $@ in super class '" + supercls.getName() +
46+
"'.", assign, "attribute"

python/ql/src/Classes/SuperInOldStyleClass.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ predicate uses_of_super_in_old_style_class(Call s) {
2424

2525
from Call c
2626
where uses_of_super_in_old_style_class(c)
27-
select c, "super() will not work in old-style classes"
27+
select c, "'super()' will not work in old-style classes."

python/ql/src/Classes/UndefinedClassAttribute.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ predicate report_undefined_class_attribute(Attribute a, ClassObject c, string na
3030

3131
from Attribute a, ClassObject c, string name
3232
where report_undefined_class_attribute(a, c, name)
33-
select a, "Attribute '" + name + "' is not defined in either the class body or in any method"
33+
select a, "Attribute '" + name + "' is not defined in either the class body or in any method."

python/ql/src/Exceptions/RaisingTuple.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ where
2121
major_version() = 2
2222
/* Raising a tuple is a type error in Python 3, so is handled by the IllegalRaise query. */
2323
select r,
24-
"Raising $@ will result in the first element (recursively) being raised and all other elements being discarded.",
25-
origin, "a tuple"
24+
"Raising a $@ will result in the first element (recursively) being raised and all other elements being discarded.",
25+
origin, "tuple"

python/ql/src/Exceptions/UnguardedNextInGenerator.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ where
7373
// However, we do not know the minor version of the analyzed code (only of the extractor),
7474
// so we only alert on Python 2.
7575
major_version() = 2
76-
select call, "Call to next() in a generator"
76+
select call, "Call to 'next()' in a generator."

python/ql/src/Expressions/Comparisons/UselessComparisonTest.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ private predicate useless_test_ast(AstNode comp, AstNode previous, boolean isTru
4848
from Expr test, Expr other, boolean isTrue
4949
where
5050
useless_test_ast(test, other, isTrue) and not useless_test_ast(test.getAChildNode+(), other, _)
51-
select test, "Test is always " + isTrue + ", because of $@", other, "this condition"
51+
select test, "Test is always " + isTrue + ", because of $@.", other, "this condition"

python/ql/src/Functions/DeprecatedSliceMethod.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ where
2121
not f.isOverridingMethod() and
2222
slice_method_name(meth) and
2323
f.getName() = meth
24-
select f, meth + " method has been deprecated since Python 2.0"
24+
select f, meth + " method has been deprecated since Python 2.0."

python/ql/src/Functions/ModificationOfParameterWithDefault.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ from
1919
ModificationOfParameterWithDefault::Configuration config, DataFlow::PathNode source,
2020
DataFlow::PathNode sink
2121
where config.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "This expression mutates $@.", source.getNode(),
23-
"a default value"
22+
select sink.getNode(), source, sink, "This expression mutates a $@.", source.getNode(),
23+
"default value"

0 commit comments

Comments
 (0)