@@ -50,19 +50,20 @@ type Component struct {
5050}
5151
5252type Report struct {
53- Success bool `json:"success"`
54- created time.Time
55- Snapshot string `json:"snapshot,omitempty"`
56- Components []Component `json:"components"`
57- Key string `json:"key"`
58- Policy ecc.EnterpriseContractPolicySpec `json:"policy"`
59- EcVersion string `json:"ec-version"`
60- Data any `json:"-"`
61- EffectiveTime time.Time `json:"effective-time"`
62- PolicyInput [][]byte `json:"-"`
63- ShowSuccesses bool `json:"-"`
64- ShowWarnings bool `json:"-"`
65- Expansion * ExpansionInfo `json:"-"`
53+ Success bool `json:"success"`
54+ created time.Time
55+ Snapshot string `json:"snapshot,omitempty"`
56+ Components []Component `json:"components"`
57+ Key string `json:"key"`
58+ Policy ecc.EnterpriseContractPolicySpec `json:"policy"`
59+ EcVersion string `json:"ec-version"`
60+ Data any `json:"-"`
61+ EffectiveTime time.Time `json:"effective-time"`
62+ PolicyInput [][]byte `json:"-"`
63+ ShowSuccesses bool `json:"-"`
64+ ShowWarnings bool `json:"-"`
65+ ShowPolicyDocsLink bool `json:"-"`
66+ Expansion * ExpansionInfo `json:"-"`
6667}
6768
6869type summary struct {
@@ -128,7 +129,7 @@ var OutputFormats = []string{
128129
129130// WriteReport returns a new instance of Report representing the state of
130131// components from the snapshot.
131- func NewReport (snapshot string , components []Component , policy policy.Policy , policyInput [][]byte , showSuccesses bool , showWarnings bool , expansion * ExpansionInfo ) (Report , error ) {
132+ func NewReport (snapshot string , components []Component , policy policy.Policy , policyInput [][]byte , showSuccesses bool , showWarnings bool , showPolicyDocsLink bool , expansion * ExpansionInfo ) (Report , error ) {
132133 success := true
133134
134135 // Set the report success, remains true if all components are successful
@@ -149,18 +150,19 @@ func NewReport(snapshot string, components []Component, policy policy.Policy, po
149150 info , _ := version .ComputeInfo ()
150151
151152 return Report {
152- Snapshot : snapshot ,
153- Success : success ,
154- Components : components ,
155- created : time .Now ().UTC (),
156- Key : string (key ),
157- Policy : policy .Spec (),
158- EcVersion : info .Version ,
159- PolicyInput : policyInput ,
160- EffectiveTime : policy .EffectiveTime ().UTC (),
161- ShowSuccesses : showSuccesses ,
162- ShowWarnings : showWarnings ,
163- Expansion : expansion ,
153+ Snapshot : snapshot ,
154+ Success : success ,
155+ Components : components ,
156+ created : time .Now ().UTC (),
157+ Key : string (key ),
158+ Policy : policy .Spec (),
159+ EcVersion : info .Version ,
160+ PolicyInput : policyInput ,
161+ EffectiveTime : policy .EffectiveTime ().UTC (),
162+ ShowSuccesses : showSuccesses ,
163+ ShowWarnings : showWarnings ,
164+ ShowPolicyDocsLink : showPolicyDocsLink ,
165+ Expansion : expansion ,
164166 }, nil
165167}
166168
@@ -264,6 +266,7 @@ func (r *Report) toSummary() summary {
264266func (r * Report ) applyOptions (opts format.Options ) {
265267 r .ShowSuccesses = opts .ShowSuccesses
266268 r .ShowWarnings = opts .ShowWarnings
269+ r .ShowPolicyDocsLink = opts .ShowPolicyDocsLink
267270}
268271
269272// condensedMsg reduces repetitive error messages.
0 commit comments