File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -934,22 +934,15 @@ public Tuple<List<SuppressedRecord>, List<DiagnosticRecord>> SuppressRule(string
934934 break ;
935935 }
936936
937- if ( string . IsNullOrWhiteSpace ( ruleSuppression . RuleSuppressionID ) )
937+ // we suppress if there is no suppression id or if there is suppression id and it matches
938+ if ( string . IsNullOrWhiteSpace ( ruleSuppression . RuleSuppressionID )
939+ || ( ! String . IsNullOrWhiteSpace ( record . RuleSuppressionID ) &&
940+ string . Equals ( ruleSuppression . RuleSuppressionID , record . RuleSuppressionID , StringComparison . OrdinalIgnoreCase ) ) )
938941 {
939942 suppressed [ recordIndex ] = true ;
943+ suppressedRecords . Add ( new SuppressedRecord ( record , ruleSuppression ) ) ;
940944 suppressionCount += 1 ;
941945 }
942- else
943- {
944- //if there is a rule suppression id, we only suppressed if it matches
945- if ( ! String . IsNullOrWhiteSpace ( record . RuleSuppressionID ) &&
946- string . Equals ( ruleSuppression . RuleSuppressionID , record . RuleSuppressionID , StringComparison . OrdinalIgnoreCase ) )
947- {
948- suppressed [ recordIndex ] = true ;
949- suppressedRecords . Add ( new SuppressedRecord ( record , ruleSuppression ) ) ;
950- suppressionCount += 1 ;
951- }
952- }
953946
954947 recordIndex += 1 ;
955948 }
You can’t perform that action at this time.
0 commit comments