diff --git a/pkg/result/processors/fixer.go b/pkg/result/processors/fixer.go index 3f7abbc8..29313d7f 100644 --- a/pkg/result/processors/fixer.go +++ b/pkg/result/processors/fixer.go @@ -223,6 +223,12 @@ func (f Fixer) writeFixedFile(origFileLines [][]byte, issues []result.Issue, tmp } else { nextIssueIndex++ rng := nextIssue.GetLineRange() + if rng.From > rng.To { + // Maybe better decision is to skip such issues, re-evaluate if regressed. + f.log.Warnf("[fixer]: issue line range is probably invalid, fix can be incorrect (from=%d, to=%d, linter=%s)", + rng.From, rng.To, nextIssue.FromLinter, + ) + } i += rng.To - rng.From if nextIssue.Replacement.NeedOnlyDelete { continue