@@ -99,7 +99,34 @@ func shouldSkipFile(f string) bool {
99
99
}
100
100
}
101
101
102
- // initializeTable initializes the table for the rule type
103
- func initializeTable () table.Table {
104
- return table .New (table .Simple , layouts .RuleType , nil )
102
+ // initializeTableForList initializes the table for the rule type
103
+ func initializeTableForList () table.Table {
104
+ return table .New (table .Simple , layouts .RuleTypeList , nil )
105
+ }
106
+
107
+ // initializeTableForList initializes the table for the rule type
108
+ func initializeTableForOne () table.Table {
109
+ return table .New (table .Simple , layouts .RuleTypeOne , nil )
110
+ }
111
+
112
+ func oneRuleTypeToRows (t table.Table , rt * minderv1.RuleType ) {
113
+ t .AddRow ("ID" , * rt .Id )
114
+ t .AddRow ("Name" , rt .Name )
115
+ t .AddRow ("Provider" , * rt .Context .Provider )
116
+ t .AddRow ("Project" , * rt .Context .Project )
117
+ t .AddRow ("Description" , rt .Description )
118
+ t .AddRow ("Ingest type" , rt .Def .Ingest .Type )
119
+ t .AddRow ("Eval type" , rt .Def .Eval .Type )
120
+ rem := "unsupported"
121
+ if rt .Def .GetRemediate () != nil {
122
+ rem = rt .Def .GetRemediate ().Type
123
+ }
124
+ t .AddRow ("Remediation" , rem )
125
+
126
+ alert := "unsupported"
127
+ if rt .Def .GetAlert () != nil {
128
+ alert = rt .Def .GetAlert ().Type
129
+ }
130
+
131
+ t .AddRow ("Alert" , alert )
105
132
}
0 commit comments