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
934
934
break ;
935
935
}
936
936
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 ) ) )
938
941
{
939
942
suppressed [ recordIndex ] = true ;
943
+ suppressedRecords . Add ( new SuppressedRecord ( record , ruleSuppression ) ) ;
940
944
suppressionCount += 1 ;
941
945
}
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
- }
953
946
954
947
recordIndex += 1 ;
955
948
}
You can’t perform that action at this time.
0 commit comments