mirror of
https://github.com/mgechev/revive.git
synced 2025-01-22 03:38:47 +02:00
fix off by one issue in line and colums (#773)
This commit is contained in:
parent
7b1458a9cb
commit
ae282a54c8
@ -81,8 +81,8 @@ func (l *reviveRunLog) AddResult(failure lint.Failure) {
|
||||
}
|
||||
position := failure.Position
|
||||
filename := position.Start.Filename
|
||||
line := positiveOrZero(position.Start.Line - 1) // https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#def_line
|
||||
column := positiveOrZero(position.Start.Column - 1) // https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#def_column
|
||||
line := positiveOrZero(position.Start.Line) // https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#def_line
|
||||
column := positiveOrZero(position.Start.Column) // https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#def_column
|
||||
|
||||
result := garif.NewResult(garif.NewMessageFromText(failure.Failure))
|
||||
location := garif.NewLocation().WithURI(filename).WithLineColumn(line, column)
|
||||
|
Loading…
x
Reference in New Issue
Block a user