Skip to content

Commit

Permalink
cleaned up linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Dec 13, 2023
1 parent df41dd3 commit c6d0988
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion motor/rule_applicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ components:
},
})

//nolint:staticcheck // ignore this linting issue, its no a bug, it's on purpose.
//nolint:staticcheck // ignore this linting issue, it's not a bug, it's on purpose.
time.Sleep(100)
assert.True(t, panicRan)

Expand Down
7 changes: 3 additions & 4 deletions rulesets/remote_ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// CheckForRemoteExtends checks if the extends map contains a remote link
// returns true if it does, false if it does not
func CheckForRemoteExtends(extends map[string]string) bool {
for k, _ := range extends {
for k := range extends {
if strings.HasPrefix(k, "http") {
return true
}
Expand All @@ -29,7 +29,7 @@ func CheckForRemoteExtends(extends map[string]string) bool {
// CheckForLocalExtends checks if the extends map contains a local link
// returns true if it does, false if it does not
func CheckForLocalExtends(extends map[string]string) bool {
for k, _ := range extends {
for k := range extends {
if filepath.Ext(k) == ".yaml" || filepath.Ext(k) == ".json" {
return true
}
Expand Down Expand Up @@ -166,7 +166,7 @@ func SniffOutAllExternalRules(

// do we have extensions?
if CheckForRemoteExtends(extends) || CheckForLocalExtends(extends) {
for k, _ := range extends {
for k := range extends {
if strings.HasPrefix(k, "http") || filepath.Ext(k) == ".yaml" || filepath.Ext(k) == ".json" {
if slices.Contains(visited, k) {
rsm.logger.Warn("ruleset links to its self, circular rulesets are not permitted",
Expand All @@ -179,5 +179,4 @@ func SniffOutAllExternalRules(
}
}
}
return
}
2 changes: 1 addition & 1 deletion rulesets/rulesets.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (rsm ruleSetsModel) GenerateRuleSetFromSuppliedRuleSet(ruleset *RuleSet) *R

go func() {

for k, _ := range extends {
for k := range extends {
if strings.HasPrefix(k, "http") || filepath.Ext(k) == ".yaml" || filepath.Ext(k) == ".json" {
total++
remote := false
Expand Down

0 comments on commit c6d0988

Please sign in to comment.