Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Jul 23, 2024
1 parent 076af24 commit 54e4c29
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/linter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,23 +498,15 @@ func cloneRulesForFile(filename string, ruleSet *rules.ScopedSet) *rules.ScopedS
continue
}

match := false

if rule.Paths == nil {
if strings.Contains(filename, "") {
match = true
}
} else {
for _, path := range rule.Paths {
if strings.Contains(filename, path) {
match = true
break
}
}
res = append(res, rule)
}

if match {
res = append(res, rule)
for _, path := range rule.Paths {
if strings.Contains(filename, path) {
res = append(res, rule)
break
}
}
}
clone.Set(ir.NodeKind(kind), res)
Expand Down

0 comments on commit 54e4c29

Please sign in to comment.