Skip to content

Commit

Permalink
fixing issues with json reporting and grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
kehoecj committed Dec 18, 2024
1 parent 7308484 commit 4bf5b9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions cmd/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 4bf5b9e

Please sign in to comment.