Skip to content

Commit

Permalink
fixed checkstyle messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Mar 18, 2016
1 parent c1beacd commit 6fb4590
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/checkstyle/Checker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Checker {

function findLineSeparator() {
var code = file.content;
for (i in 0 ... code.length) {
for (i in 0...code.length) {
var char = code.charAt(i);
if (char == "\r" || char == "\n") {
lineSeparator = char;
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/ChecksInfo.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ChecksInfo {
for (cl in checksClasses) {
if (ignoreClass(cl)) continue;
var names:Array<Dynamic> = getCheckNameFromClass(cl);
for (i in 0 ... names.length) {
for (i in 0...names.length) {
var desc = getCheckDescription(cl);
checkInfos[names[i]] = {
name: names[i],
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/Check.hx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Check {

function isLineSuppressed(i:Int):Bool {
var pos:Int = 0;
for (j in 0 ... i + 1) pos += checker.lines[j].length;
for (j in 0...i + 1) pos += checker.lines[j].length;
return isCharPosSuppressed(pos);
}

Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/coding/DefaultComesLastCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefaultComesLastCheck extends Check {
if (tokens[tokens.length - 1].is(Kwd(KwdDefault))) continue;

var defaultExists = false;
for (i in 0 ... tokens.length) {
for (i in 0...tokens.length) {
if (tokens[i].is(Kwd(KwdDefault)) && i < tokens.length - 1) {
logPos("Default should be last label in the switch", token.pos);
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/size/LineLengthCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LineLengthCheck extends Check {

override function actualRun() {
var ignoreRE = new EReg(ignorePattern, "");
for (i in 0 ... checker.lines.length) {
for (i in 0...checker.lines.length) {
var line = checker.lines[i];
if (line.length > max) {
if (ignoreRE.match(line) || isLineSuppressed(i)) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/whitespace/EmptyLinesCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class EmptyLinesCheck extends LineCheckBase {
var start = 0;
var end = 0;

for (i in 0 ... checker.lines.length) {
for (i in 0...checker.lines.length) {
var line = checker.lines[i];
if (isMultineString(line)) continue;
if (~/^\s*$/.match(line)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class IndentationCharacterCheck extends LineCheckBase {
override function actualRun() {
var ignoreRE = new EReg(ignorePattern, "");
var re = (character == TAB) ? ~/^\t*(\S.*| \*.*)?$/ : ~/^ *(\S.*)?$/;
for (i in 0 ... checker.lines.length) {
for (i in 0...checker.lines.length) {
var line = checker.lines[i];
if (ignoreRE.match(line) || isLineSuppressed(i)) continue;
if (isMultineString(line)) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/checkstyle/checks/whitespace/TabForAligningCheck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TabForAligningCheck extends LineCheckBase {
override function actualRun() {
var ignoreRE = new EReg(ignorePattern, "");
var re = ~/^\s*\S[^\t]*\t/;
for (i in 0 ... checker.lines.length) {
for (i in 0...checker.lines.length) {
var line = checker.lines[i];
if (ignoreRE.match(line)) continue;
if (isMultineString(line)) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TrailingWhitespaceCheck extends LineCheckBase {

override function actualRun() {
var re = ~/\s+$/;
for (i in 0 ... checker.lines.length) {
for (i in 0...checker.lines.length) {
var line = checker.lines[i];
if (isMultineString(line)) continue;
if (re.match(line)) log("Trailing whitespace", i + 1, line.length);
Expand Down
2 changes: 1 addition & 1 deletion test/TestMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestMain {
for (cls in classes) {
var coverageData = [null];
var results:CoverageResult = cls.getResults();
for (i in 1 ... results.l) coverageData[i] = 1;
for (i in 1...results.l) coverageData[i] = 1;
var c = cls.name.replace(".", "/") + ".hx";

var missingStatements:Array<Statement> = cls.getMissingStatements();
Expand Down
2 changes: 2 additions & 0 deletions test/checks/whitespace/OperatorWhitespaceCheckTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ abstract OperatorWhitespaceCheckTests(String) to String {
function test() {
if (!test) return a++;
++a;
return !(a++);
}
}";

Expand All @@ -345,6 +346,7 @@ abstract OperatorWhitespaceCheckTests(String) to String {
function test() {
if (! test) return a ++;
++ a;
return ! (a ++);
}
}";

Expand Down

0 comments on commit 6fb4590

Please sign in to comment.