diff options
Diffstat (limited to 'pkgtools/pkglint/files/autofix.go')
-rw-r--r-- | pkgtools/pkglint/files/autofix.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pkgtools/pkglint/files/autofix.go b/pkgtools/pkglint/files/autofix.go index 78b050d03bc..249b616d72c 100644 --- a/pkgtools/pkglint/files/autofix.go +++ b/pkgtools/pkglint/files/autofix.go @@ -142,13 +142,6 @@ func (fix *Autofix) ReplaceAt(rawIndex int, textIndex int, from string, to strin assert(from != to) fix.assertRealLine() - // XXX: This should only affect the diagnostics, but not the modifications - // to the text of the affected line, since that text will be used in - // further checks. - if fix.skip() { - return - } - rawLine := fix.line.raw[rawIndex] assert(textIndex < len(rawLine.textnl)) assert(hasPrefix(rawLine.textnl[textIndex:], from)) @@ -166,6 +159,9 @@ func (fix *Autofix) ReplaceAt(rawIndex int, textIndex int, from string, to strin // This probably requires a generic notification mechanism. _, fix.line.Text = replaceOnce(fix.line.Text, from, to) + if fix.skip() { + return + } fix.Describef(rawLine.Lineno, "Replacing %q with %q.", from, to) } |