Skip to content

Commit e593eef

Browse files
committed
Allow a single issue to fulfill multiple ignore ranges
1 parent 1b24cfe commit e593eef

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/golinters/scopelint.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (f *Node) Visit(node ast.Node) ast.Visitor {
163163
// The variadic arguments may start with link and category types,
164164
// and must end with a format string and any arguments.
165165
// It returns the new Problem.
166+
//nolint:interfacer
166167
func (f *Node) errorf(n ast.Node, format string, args ...interface{}) {
167168
pos := f.fset.Position(n.Pos())
168169
f.errorAtf(pos, format, args...)

pkg/result/processors/nolint.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,16 @@ func (p *Nolint) shouldPassIssue(i *result.Issue) (bool, error) {
161161
return false, err
162162
}
163163

164+
matchesSomething := false
164165
for _, ir := range fd.ignoredRanges {
165166
if ir.doesMatch(i) {
167+
// for nolintlint, we need to consider every range
166168
ir.matchedIssueFromLinter[i.FromLinter] = true
167-
return false, nil
169+
matchesSomething = true
168170
}
169171
}
170172

171-
return true, nil
173+
return !matchesSomething, nil
172174
}
173175

174176
type rangeExpander struct {

0 commit comments

Comments
 (0)