Warning message consistency
This commit is contained in:
parent
fab67f9abd
commit
cc7d0112f3
|
|
@ -76,7 +76,7 @@ class AutoRefAssignmentCheck : BaseAnalyzer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum string MESSAGE = "Assignment to auto-ref function parameter";
|
enum string MESSAGE = "Assignment to auto-ref function parameter.";
|
||||||
enum string KEY = "dscanner.suspicious.auto_ref_assignment";
|
enum string KEY = "dscanner.suspicious.auto_ref_assignment";
|
||||||
|
|
||||||
invariant
|
invariant
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,14 @@ import dparse.lexer;
|
||||||
import analysis.base;
|
import analysis.base;
|
||||||
import dsymbol.scope_ : Scope;
|
import dsymbol.scope_ : Scope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks for redundant parenthesis
|
||||||
|
*/
|
||||||
class RedundantParenCheck : BaseAnalyzer
|
class RedundantParenCheck : BaseAnalyzer
|
||||||
{
|
{
|
||||||
alias visit = BaseAnalyzer.visit;
|
alias visit = BaseAnalyzer.visit;
|
||||||
|
|
||||||
|
///
|
||||||
this(string fileName, const(Scope)* sc)
|
this(string fileName, const(Scope)* sc)
|
||||||
{
|
{
|
||||||
super(fileName, sc);
|
super(fileName, sc);
|
||||||
|
|
@ -32,7 +36,7 @@ class RedundantParenCheck : BaseAnalyzer
|
||||||
if (unary.primaryExpression.expression is null)
|
if (unary.primaryExpression.expression is null)
|
||||||
goto end;
|
goto end;
|
||||||
addErrorMessage(unary.primaryExpression.expression.line,
|
addErrorMessage(unary.primaryExpression.expression.line,
|
||||||
unary.primaryExpression.expression.column, KEY, "Redundant parenthesis");
|
unary.primaryExpression.expression.column, KEY, "Redundant parenthesis.");
|
||||||
end:
|
end:
|
||||||
statement.accept(this);
|
statement.accept(this);
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +54,7 @@ class RedundantParenCheck : BaseAnalyzer
|
||||||
if (unary.primaryExpression.expression is null)
|
if (unary.primaryExpression.expression is null)
|
||||||
goto end;
|
goto end;
|
||||||
addErrorMessage(primaryExpression.expression.line,
|
addErrorMessage(primaryExpression.expression.line,
|
||||||
primaryExpression.expression.column, KEY, "Redundant parenthesis");
|
primaryExpression.expression.column, KEY, "Redundant parenthesis.");
|
||||||
end:
|
end:
|
||||||
primaryExpression.accept(this);
|
primaryExpression.accept(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue