Skip to content

Commit

Permalink
🐛 look for default rules provider in foundProviders (#312)
Browse files Browse the repository at this point in the history
Signed-off-by: David Zager <[email protected]>
  • Loading branch information
djzager authored Aug 7, 2024
1 parent 5865fea commit 766454b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,8 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {

// default rulesets are only java rules
// may want to change this in the future
if len(foundProviders) > 0 && len(analyzeCmd.rules) == 0 {
if _, ok := analyzeCmd.providersMap[javaProvider]; !ok {
return fmt.Errorf("No providers found with default rules. Use --rules option")
}
if len(foundProviders) > 0 && len(analyzeCmd.rules) == 0 && !slices.Contains(foundProviders, javaProvider) {
return fmt.Errorf("No providers found with default rules. Use --rules option")
}

xmlOutputDir, err := analyzeCmd.ConvertXML(cmd.Context())
Expand Down

0 comments on commit 766454b

Please sign in to comment.