Skip to content

Commit

Permalink
new release
Browse files Browse the repository at this point in the history
  • Loading branch information
adireddy committed Feb 28, 2016
1 parent bde75bd commit 9311af0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHECKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

`Info: LINE - 16: MagicNumber - Magic number "7" detected - consider using a constant`

`Info: LINE - 143: MagicNumber - Magic number "-3" detected - consider using a constant`
`Info: LINE - 148: MagicNumber - Magic number "-3" detected - consider using a constant`

`Info: LINE - 104: MemberName - Invalid enum member signature: ALL (name should be ~/^[a-z][a-zA-Z0-9]*$/)`

Expand Down
6 changes: 3 additions & 3 deletions checkstyle/checks/NeedBracesCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class NeedBracesCheck extends Check {

function hasToken(token:String):Bool {
if (tokens.length == 0) return true;
if (tokens.indexOf (token) > -1) return true;
if (tokens.indexOf(token) > -1) return true;
return false;
}

override function actualRun() {
ExprUtils.walkFile(checker.ast, function(e) {
if (isPosSuppressed(e.pos)) return;
switch(e.expr) {
case EFor (it, expr):
case EFor(it, expr):
if (!hasToken(FOR)) return;
var itLine:LinePos = checker.getLinePos(it.pos.max);
var exprLine:LinePos = checker.getLinePos(expr.pos.min);
Expand All @@ -43,7 +43,7 @@ class NeedBracesCheck extends Check {
var condLine:LinePos = checker.getLinePos(econd.pos.max);
var ifLine:LinePos = checker.getLinePos(eif.pos.min);
var elseSameLine:Bool = false;
if (eelse != null){
if (eelse != null) {
var elseLine:LinePos = checker.getLinePos(eelse.pos.min);
var line:String = checker.lines[elseLine.line];
if (StringTools.startsWith(StringTools.trim(line), "else")) elseSameLine = true;
Expand Down
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"adireddy"
],
"releasenote": "bug fixes",
"version": "1.2.2",
"version": "1.2.3",
"url": "https://github.com/adireddy/haxe-checkstyle",
"dependencies": {

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "checkstyle",
"version": "1.2.2",
"version": "1.2.3",
"description": "Automated code analysis ideal for projects that want to enforce a coding standard.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion resources/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"props": {
"severity": "WARNING",
"allowSingleLineStatement": true,
"tokens": []
"tokens": ["IF", "ELSE_IF", "FOR", "WHILE", "TRY", "CATCH"]
}
},
{
Expand Down
4 changes: 3 additions & 1 deletion resources/static-analysis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@
<file name="checkstyle&#x2F;LintMessage.hx">
</file>
<file name="checkstyle&#x2F;Main.hx">
<error line="143" column="24" severity="info" message="MagicNumber - Magic number &quot;-3&quot; detected - consider using a constant" source="checkstyle&#x2F;Main.hx"/>
<error line="148" column="24" severity="info" message="MagicNumber - Magic number &quot;-3&quot; detected - consider using a constant" source="checkstyle&#x2F;Main.hx"/>
</file>
<file name="checkstyle&#x2F;Report.hx">
</file>
<file name="checkstyle&#x2F;reporter&#x2F;ExitCodeReporter.hx">
</file>
<file name="checkstyle&#x2F;reporter&#x2F;IReporter.hx">
</file>
<file name="checkstyle&#x2F;reporter&#x2F;Reporter.hx">
Expand Down

0 comments on commit 9311af0

Please sign in to comment.