diff --git a/pkg/output/stdout.go b/pkg/output/stdout.go index 996eddd..ad2ec2b 100644 --- a/pkg/output/stdout.go +++ b/pkg/output/stdout.go @@ -15,11 +15,11 @@ import ( type Stdout struct { // Plugin-specific fields. - // Format is the output format. One of "pretty", "table", "json". + // Format is the output format. One of "pretty", "table", "json", "junit". Format string `yaml:"format"` } -var OutputFormats = []string{"json", "pretty", "table"} +var OutputFormats = []string{"json", "pretty", "table", "junit"} var s = &Stdout{Format: "pretty"} func init() { diff --git a/pkg/shipshape/shipshape.go b/pkg/shipshape/shipshape.go index 3665860..54a8533 100644 --- a/pkg/shipshape/shipshape.go +++ b/pkg/shipshape/shipshape.go @@ -52,6 +52,13 @@ func Init() error { RunConfig = cfg RunResultList = result.NewResultList(Remediate) + RunResultList.Policies = map[string][]string{} + for ct, checks := range RunConfig.Checks { + RunResultList.Policies[string(ct)] = []string{} + for _, c := range checks { + RunResultList.Policies[string(ct)] = append(RunResultList.Policies[string(ct)], c.GetName()) + } + } log.WithFields(log.Fields{ "ProjectDir": config.ProjectDir,