diff --git a/common/rc_item.cpp b/common/rc_item.cpp index 61ca4cce81..32d31d7dc6 100644 --- a/common/rc_item.cpp +++ b/common/rc_item.cpp @@ -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; diff --git a/include/rc_json_schema.h b/include/rc_json_schema.h index b185e919e1..9213619395 100644 --- a/include/rc_json_schema.h +++ b/include/rc_json_schema.h @@ -56,6 +56,7 @@ struct VIOLATION wxString severity; std::vector 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 diff --git a/resources/schemas/drc.v1.json b/resources/schemas/drc.v1.json index 0894e227eb..c1dbd8ec70 100644 --- a/resources/schemas/drc.v1.json +++ b/resources/schemas/drc.v1.json @@ -86,6 +86,10 @@ "excluded": { "type": "boolean", "default": false + }, + "comment": { + "type": "string", + "description": "Comment added when excluding the violation" } }, "required": [