Skip to content

Commit

Permalink
Detect ruleset in uploaded rules files.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <jortel@redhat.com>
  • Loading branch information
jortel committed Dec 11, 2023
1 parent c793d0c commit 72a384d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/rules.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"github.com/konveyor/analyzer-lsp/parser"
"github.com/konveyor/tackle2-addon/command"
"github.com/konveyor/tackle2-addon/repository"
"github.com/konveyor/tackle2-hub/api"
Expand Down Expand Up @@ -83,9 +84,14 @@ func (r *Rules) addFiles() (err error) {
return
}
for _, ent := range entries {
r.rules = append(
r.rules,
path.Join(ruleDir, ent.Name()))
if ent.Name() == parser.RULE_SET_GOLDEN_FILE_NAME {
r.rules = append(r.rules, ruleDir)
return
}
}
for _, ent := range entries {
p := path.Join(ruleDir, ent.Name())
r.rules = append(r.rules, p)
}
return
}
Expand Down

0 comments on commit 72a384d

Please sign in to comment.