Make DRC exclusions work in cli & python DRC

The way exclusions work is actually silly, and you can end up with your project file losing them too.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11562
This commit is contained in:
Marek Roszko
2024-01-10 19:55:44 -05:00
parent 4b1fc9c129
commit d0236ca751
8 changed files with 32 additions and 20 deletions
@@ -585,9 +585,15 @@ bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
}
} );
aBoard->RecordDRCExclusions();
aBoard->DeleteMARKERs( true, true );
engine->RunTests( aUnits, aReportAllTrackErrors, false );
engine->ClearViolationHandler();
// now "resolve" the drc exclusions again because its the only way to set exclusion status on a marker
for( PCB_MARKER* marker : aBoard->ResolveDRCExclusions( false ) )
aBoard->Add( marker );
// TODO: Unify this with DIALOG_DRC::writeReport
FILE* fp = wxFopen( aFileName, wxT( "w" ) );