Skip to content

Commit

Permalink
Work around linter reporting :0:0 location
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-vinted committed Jul 3, 2023
1 parent 341ea12 commit 38bb0cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ internal class PackwerkAnnotator : ExternalAnnotator<PackwerkAnnotator.State, Pa
while (scanner.hasNextLine()) {
val matches = violationPattern.matchEntire(scanner.nextLine())
if (matches != null) {
val lineNumber = Integer.valueOf(matches.groupValues[1]) - 1
val columnNumber = Integer.valueOf(matches.groupValues[2]) - 1
val lineNumber = (Integer.valueOf(matches.groupValues[1]) - 1).coerceAtLeast(0)
val columnNumber = (Integer.valueOf(matches.groupValues[2]) - 1).coerceAtLeast(0)
val explanation = scanner.nextLine()

problems.push(Problem(lineNumber, columnNumber, explanation))
Expand Down

0 comments on commit 38bb0cb

Please sign in to comment.