Skip to content

Commit

Permalink
fix: updated benchmarks table
Browse files Browse the repository at this point in the history
  • Loading branch information
ADorigi committed Sep 15, 2024
1 parent 691c315 commit 38fc98c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/output/tables/compliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ func PrintBenchmarksTable(rows [][]string) {
style.Width(40)
case col == 2:
style.Width(10)
case col == 3:
style.Width(10)
case col == 4:
style.Width(10)
}
return style
}).
Headers("BENCHMARK ID", "BENCHMARK TITLE", "# OF PRIMARY TABLES").
Headers("BENCHMARK ID", "BENCHMARK TITLE", "# OF CONTROLS", "# OF PRIMARY TABLES", "CONNECTORS").
Rows(rows...)

fmt.Println(t)
Expand Down
2 changes: 2 additions & 0 deletions pkg/types/benchmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ type Metadata struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Connectors []string `json:"connectors"`
NumberOfControls int `json:"number_of_controls"`
Enabled bool `json:"enabled"`
TrackDriftEvents bool `json:"track_drift_events"`
PrimaryTables []string `json:"primary_tables"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/utils/table_rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"encoding/json"
"strconv"
"strings"

"github.com/adorigi/opengovernance/pkg/types"
)
Expand Down Expand Up @@ -33,7 +34,9 @@ func GenerateBenchmarkRows(benchmarks []types.BenchMark) [][]string {
row := []string{
benchmark.Metadata.ID,
benchmark.Metadata.Title,
strconv.Itoa(benchmark.Metadata.NumberOfControls),
strconv.Itoa(len(benchmark.Metadata.PrimaryTables)),
strings.Join(benchmark.Metadata.Connectors, ","),
}
rows = append(rows, row)
}
Expand Down

0 comments on commit 38fc98c

Please sign in to comment.