add DRC exclusion comment to JSON report

closes #22330.

(cherry picked from commit 80e148fb68)
This commit is contained in:
Bernhard Kirchen
2025-11-15 21:32:20 +01:00
committed by Jeff Young
parent 677750b64e
commit bd2152bb3d
3 changed files with 12 additions and 0 deletions
+3
View File
@@ -174,6 +174,9 @@ void RC_ITEM::GetJsonViolation( RC_JSON::VIOLATION& aViolation, UNITS_PROVIDER*
aViolation.type = GetSettingsKey();
aViolation.excluded = ( m_parent && m_parent->IsExcluded() );
if( m_parent && m_parent->IsExcluded() && !m_parent->GetComment().IsEmpty() )
aViolation.comment = m_parent->GetComment();
EDA_ITEM* mainItem = nullptr;
EDA_ITEM* auxItem = nullptr;
+5
View File
@@ -56,6 +56,7 @@ struct VIOLATION
wxString severity;
std::vector<AFFECTED_ITEM> items;
bool excluded;
wxString comment;
};
inline void to_json( nlohmann::json& aJson, const VIOLATION& aViolation )
@@ -66,7 +67,10 @@ inline void to_json( nlohmann::json& aJson, const VIOLATION& aViolation )
aJson["items"] = aViolation.items;
if( aViolation.excluded )
{
aJson["excluded"] = aViolation.excluded;
aJson["comment"] = aViolation.comment;
}
}
inline void from_json( const nlohmann::json& aJson, VIOLATION& aViolation )
{
@@ -75,6 +79,7 @@ inline void from_json( const nlohmann::json& aJson, VIOLATION& aViolation )
aJson.at( "severity" ).get_to( aViolation.severity );
aJson.at( "items" ).get_to( aViolation.items );
aJson.at( "excluded" ).get_to( aViolation.excluded );
aJson.at( "comment" ).get_to( aViolation.comment );
}
struct REPORT_BASE
+4
View File
@@ -86,6 +86,10 @@
"excluded": {
"type": "boolean",
"default": false
},
"comment": {
"type": "string",
"description": "Comment added when excluding the violation"
}
},
"required": [