Skip to content

Commit

Permalink
CodeQuality имеет 1-based номера строк
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed Feb 22, 2025
1 parent 375e5f3 commit c85c91f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public CodeQualityReportEntry(String path, Diagnostic diagnostic, DiagnosticInfo
this.location = new Location();
this.location.path = path;
this.location.lines = new Lines();
this.location.lines.begin = diagnostic.getRange().getStart().getLine();
this.location.lines.begin = diagnostic.getRange().getStart().getLine() + 1;
}

@Getter
Expand All @@ -100,7 +100,7 @@ public static class Location {
@ToString
public static class Lines {
/**
* The line on which the code quality violation occurred.
* The line on which the code quality violation occurred (1-based).
*/
private int begin;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void testConstructor() {
.hasFieldOrPropertyWithValue("checkName", "Typo")
.hasFieldOrPropertyWithValue("severity", CodeQualityReportEntry.Severity.INFO)
.hasFieldOrPropertyWithValue("location.path", "file.txt")
.hasFieldOrPropertyWithValue("location.lines.begin", 0)
.hasFieldOrPropertyWithValue("location.lines.begin", 1)
;
}

Expand Down

0 comments on commit c85c91f

Please sign in to comment.