Skip to content

Commit

Permalink
chore: improve flow debugging
Browse files Browse the repository at this point in the history
Added some additional debugging the processing of rules to make it
easier to understand what's happening when debugging issues.
  • Loading branch information
stevenh committed Oct 25, 2023
1 parent 022a731 commit 6eb5757
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/groovy-lint-fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ class NpmGroovyLintFix {
fixSuccess = true;
this.updateNextErrorsRanges(allLines, allLinesNew, fileFixableError.lineNb, fileNm);
allLines = allLinesNew;
debug(`Fixed ${fileFixableError.ruleName} in file ${fileNm}`);
} else {
debug(`Skipping ${fileFixableError.ruleName} as no change in file ${fileNm}`);
}
}
// Line scope violation
Expand All @@ -194,6 +197,8 @@ class NpmGroovyLintFix {
if (fixedLine !== line) {
fixSuccess = true;
allLines[lineNb] = fixedLine;
} else {
debug(`Skipping ${fileFixableError.ruleName} as no change in line: ${line}`);
}
}
// Update lint results
Expand Down Expand Up @@ -271,6 +276,8 @@ class NpmGroovyLintFix {
trace(`ERROR: Fix function error: ${e.message} / ${JSON.stringify(fixableError)}`);
throw e;
}
} else {
debug(`Fix type not supported: ${fix.type} / ${JSON.stringify(fixableError)}`);
}
return newLine;
}
Expand Down

0 comments on commit 6eb5757

Please sign in to comment.