Warning message consistency

This commit is contained in:
Hackerpilot 2015-10-30 16:28:00 -07:00
parent fab67f9abd
commit cc7d0112f3
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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);
} }