MCPcopy Create free account
hub / github.com/conforma/cli / toStatus

Method toStatus

cmd/validate/vsa.go:1264–1272  ·  view source on GitHub ↗

toStatus converts ComponentResultsDisplay to status format (simple pass/fail JSON)

()

Source from the content-addressed store, hash-verified

1262
1263// toStatus converts ComponentResultsDisplay to status format (simple pass/fail JSON)
1264func (d ComponentResultsDisplay) toStatus() ([]byte, error) {
1265 resultStr := determineStatusFromOverall(d.Result.Overall)
1266 statusReport := map[string]string{"result": resultStr}
1267 data, err := json.Marshal(statusReport)
1268 if err != nil {
1269 return nil, fmt.Errorf("failed to marshal status report: %w", err)
1270 }
1271 return data, nil
1272}
1273
1274// determineStatusFromOverall extracts SUCCESS or FAILURE from overall result string
1275func determineStatusFromOverall(overall string) string {

Callers 1

toFormatMethod · 0.95

Calls 2

ErrorfMethod · 0.65

Tested by

no test coverage detected