dev: misspell: always build replacement
This commit is contained in:
parent
f8a5a8cb01
commit
360a58dca9
@ -82,15 +82,12 @@ func (lint Misspell) runOnFile(fileName string, r *misspell.Replacer, lintCtx *l
|
|||||||
Line: diff.Line,
|
Line: diff.Line,
|
||||||
Column: diff.Column + 1,
|
Column: diff.Column + 1,
|
||||||
}
|
}
|
||||||
var replacement *result.Replacement
|
replacement := &result.Replacement{
|
||||||
if lintCtx.Cfg.Issues.NeedFix {
|
Inline: &result.InlineFix{
|
||||||
replacement = &result.Replacement{
|
StartCol: diff.Column,
|
||||||
Inline: &result.InlineFix{
|
Length: len(diff.Original),
|
||||||
StartCol: diff.Column,
|
NewString: diff.Corrected,
|
||||||
Length: len(diff.Original),
|
},
|
||||||
NewString: diff.Corrected,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
res = append(res, result.Issue{
|
res = append(res, result.Issue{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user