From 4bf5b9eb32378f4057976804da68f637c1dd531d Mon Sep 17 00:00:00 2001 From: Clayton Kehoe Date: Wed, 18 Dec 2024 13:49:47 -0600 Subject: [PATCH] fixing issues with json reporting and grouping --- cmd/validator/validator.go | 2 -- pkg/cli/cli.go | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/validator/validator.go b/cmd/validator/validator.go index beccea0..1b5be82 100644 --- a/cmd/validator/validator.go +++ b/cmd/validator/validator.go @@ -238,8 +238,6 @@ func validateGroupByConf(groupBy *string) error { func validateGlobbing(globbingPrt *bool) error { if *globbingPrt && (isFlagSet("exclude-dirs") || isFlagSet("exclude-file-types")) { - fmt.Println("The -globbing flag cannot be used with --exclude-dirs or --exclude-file-types") - flag.Usage() return errors.New("the -globbing flag cannot be used with --exclude-dirs or --exclude-file-types") } return nil diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 0a3489f..8cbe6e5 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -151,7 +151,7 @@ func (c CLI) printGroupSingle(reports []reporter.Report) error { // Check reporter type to determine how to print for _, reporterObj := range c.Reporters { - if _, ok := reporterObj.(reporter.JSONReporter); ok { + if _, ok := reporterObj.(*reporter.JSONReporter); ok { return reporter.PrintSingleGroupJSON(reportGroup) } } @@ -167,7 +167,7 @@ func (c CLI) printGroupDouble(reports []reporter.Report) error { // Check reporter type to determine how to print for _, reporterObj := range c.Reporters { - if _, ok := reporterObj.(reporter.JSONReporter); ok { + if _, ok := reporterObj.(*reporter.JSONReporter); ok { return reporter.PrintDoubleGroupJSON(reportGroup) } } @@ -182,7 +182,7 @@ func (c CLI) printGroupTriple(reports []reporter.Report) error { } for _, reporterObj := range c.Reporters { - if _, ok := reporterObj.(reporter.JSONReporter); ok { + if _, ok := reporterObj.(*reporter.JSONReporter); ok { return reporter.PrintTripleGroupJSON(reportGroup) } }