ValidationReport Class
Report produced by running a ContractRegistry. More...
Declaration
Included Headers
Public Constructors Index
| ValidationReport ()=default | |
|
Construct an empty report. More... | |
Public Member Functions Index
| void | add_issue (ValidationIssue issue) |
|
Append an issue to the report. More... | |
| void | add_info (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append an Info issue. More... | |
| void | add_warning (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append a Warning issue. More... | |
| void | add_error (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={}) |
|
Append an Error issue. More... | |
| void | note_contract_run (std::string id) |
|
Record that a contract id participated in this validation pass. More... | |
| void | set_mode (int mode) |
|
Record which Graph mode produced this report (integer to avoid Contract.h include). More... | |
| int | mode () const |
|
Mode integer set via set_mode(). More... | |
| const std::vector< ValidationIssue > & | issues () const noexcept |
|
All issues collected, in insertion order. More... | |
| const std::vector< std::string > & | contracts_run () const noexcept |
|
Ids of all contracts that ran (in evaluation order). More... | |
| bool | ok () const noexcept |
|
True if the report contains no errors (warnings/info are still allowed). More... | |
| bool | has_errors () const noexcept |
|
True if at least one issue with Error severity is present. More... | |
| std::size_t | error_count () const noexcept |
|
Count of Error issues in the report. More... | |
| std::size_t | warning_count () const noexcept |
|
Count of Warning issues in the report. More... | |
| std::size_t | info_count () const noexcept |
|
Count of Info issues in the report. More... | |
| std::string | to_string () const |
|
Render the report as a deterministic, human-readable text block. More... | |
| std::string | to_json () const |
|
Serialize the report as a JSON string (CI/dashboard-friendly). More... | |
Private Member Attributes Index
| int | mode_ = 0 |
| std::vector< std::string > | contracts_run_ |
| std::vector< ValidationIssue > | issues_ |
Private Static Functions Index
| static std::string | json_escape_ (const std::string &s) |
Description
Report produced by running a ContractRegistry.
Aggregates all issues emitted by every contract that was run, plus the list of contract ids that participated. STL-only, CI-friendly, and safe to serialize via to_string() (text) or to_json() (JSON).
- See Also
- See Also
Definition at line 82 of file ValidationReport.h.