fix some more style-guide violations in the alert-messages

This commit is contained in:
erik-krogh
2022-10-07 11:23:34 +02:00
parent 5f740a5598
commit 944ca4a0da
115 changed files with 459 additions and 458 deletions

View File

@@ -13,4 +13,4 @@ import python
from Global g
where not g.getScope() instanceof Module
select g, "Updating global variables except at module initialization is discouraged"
select g, "Updating global variables except at module initialization is discouraged."

View File

@@ -44,4 +44,4 @@ predicate escaping_capturing_looping_construct(CallableExpr capturing, AstNode l
from CallableExpr capturing, AstNode loop, Variable var
where escaping_capturing_looping_construct(capturing, loop, var)
select capturing, "Capture of loop variable '$@'", loop, var.getId()
select capturing, "Capture of loop variable $@.", loop, var.getId()

View File

@@ -67,5 +67,5 @@ where
forall(Name el | el = asgn1.getParentNode().(Tuple).getAnElt() | multiply_defined(el, _, _)) and
not uninteresting_definition(asgn1)
select asgn1,
"This assignment to '" + v.getId() +
"' is unnecessary as it is redefined $@ before this value is used.", asgn2 as t, "here"
"This assignment to '" + v.getId() + "' is unnecessary as $@ before this value is used.", asgn2,
"it is redefined"

View File

@@ -67,4 +67,4 @@ where
def.defines(g) and
not assigned_pytest_fixture(g) and
not g.getId() = "_"
select d, "Local variable '" + g.getId() + "' shadows a global variable defined $@.", def, "here"
select d, "Local variable '" + g.getId() + "' shadows a $@.", def, "global variable"

View File

@@ -43,4 +43,4 @@ where
not initialized_as_local(p) and
not template_attribute(p) and
not_a_global(p)
select p, "This use of place-holder variable '" + p.getId() + "' may be undefined"
select p, "This use of place-holder variable '" + p.getId() + "' may be undefined."

View File

@@ -43,4 +43,4 @@ where
unused_local(unused, v) and
// If unused is part of a tuple, count it as unused if all elements of that tuple are unused.
forall(Name el | el = unused.getParentNode().(Tuple).getAnElt() | unused_local(el, _))
select unused, "Variable " + v.getId() + " is not used"
select unused, "Variable " + v.getId() + " is not used."