12 instantiations of Suppression
Microsoft.DotNet.ApiCompatibility (4)
Logging\SuppressionEngine.cs (3)
71
Suppression globalTargetSuppression =
new
(error.DiagnosticId, error.Target, isBaselineSuppression: error.IsBaselineSuppression);
74
Suppression globalLeftRightSuppression =
new
(string.Empty, left: error.Left, right: error.Right, isBaselineSuppression: error.IsBaselineSuppression);
77
Suppression globalDiagnosticIdLeftRightSuppression =
new
(error.DiagnosticId, left: error.Left, right: error.Right, isBaselineSuppression: error.IsBaselineSuppression);
Runner\ApiCompatRunner.cs (1)
68
Suppression suppression =
new
(difference.DiagnosticId)
Microsoft.DotNet.PackageValidation (8)
ApiCompatRunnerExtensions.cs (1)
91
log.LogWarning(new
Suppression
(DiagnosticIds.SearchDirectoriesNotFoundForTfm) { Target = displayString },
Validators\BaselinePackageValidator.cs (4)
48
log.LogError(new
Suppression
(DiagnosticIds.TargetFrameworkDropped) { Target = baselineTargetFramework.ToString() },
72
log.LogError(new
Suppression
(DiagnosticIds.TargetFrameworkDropped) { Target = baselineTargetFramework.ToString() },
101
log.LogError(new
Suppression
(DiagnosticIds.TargetFrameworkAndRidPairDropped) { Target = baselineTargetFramework.ToString() + "-" + baselineRuntimeSpecificAssetsRidGroup.Key },
136
log.LogWarning(new
Suppression
(DiagnosticIds.BaselineTargetFrameworkIgnoredButPresentInCurrentPackage,
Validators\CompatibleTFMValidator.cs (3)
44
log.LogError(new
Suppression
(DiagnosticIds.ApplicableCompileTimeAsset) { Target = framework.ToString() },
54
log.LogError(new
Suppression
(DiagnosticIds.CompatibleRuntimeRidLessAsset) { Target = framework.ToString() },
74
log.LogError(new
Suppression
(DiagnosticIds.CompatibleRuntimeRidSpecificAsset) { Target = framework.ToString() + "-" + rid },
37 references to Suppression
Microsoft.DotNet.ApiCompat.Task (4)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\SuppressionFileHelper.cs (2)
68
IReadOnlyCollection<
Suppression
> unnecessarySuppressions = suppressionEngine.GetUnnecessarySuppressions();
75
foreach (
Suppression
unnecessarySuppression in unnecessarySuppressions)
SuppressibleMSBuildLog.cs (2)
20
public bool LogError(
Suppression
suppression, string code, string message)
32
public bool LogWarning(
Suppression
suppression, string code, string message)
Microsoft.DotNet.ApiCompatibility (33)
Logging\ISuppressibleLog.cs (2)
25
bool LogError(
Suppression
suppression, string code, string message);
34
bool LogWarning(
Suppression
suppression, string code, string message);
Logging\ISuppressionEngine.cs (10)
7
/// Suppression engine that contains a collection of <see cref="
Suppression
"/> items. It provides API to add a suppression, check if a passed-in suppression is already suppressed
13
/// If true, adds the suppression to the collection when passed into <see cref="IsErrorSuppressed(
Suppression
)"/>.
20
IReadOnlyCollection<
Suppression
> BaselineSuppressions { get; }
25
IReadOnlyCollection<
Suppression
> Suppressions { get; }
30
/// <param name="suppression">The <see cref="
Suppression
"/> to be added.</param>
31
void AddSuppression(
Suppression
suppression);
37
IReadOnlyCollection<
Suppression
> GetUnnecessarySuppressions();
42
/// <param name="error">The <see cref="
Suppression
"/> error to check.</param>
44
bool IsErrorSuppressed(
Suppression
error);
58
(bool SuppressionFileUpdated, IReadOnlyCollection<
Suppression
> UpdatedSuppressions) WriteSuppressionsToFile(string suppressionOutputFile, bool preserveUnnecessarySuppressions = false);
Logging\Suppression.cs (3)
9
public class Suppression : IEquatable<
Suppression
>
72
public override bool Equals(object? obj) => Equals(obj as
Suppression
);
75
public bool Equals(
Suppression
? other)
Logging\SuppressionEngine.cs (17)
11
/// Suppression engine that contains a collection of <see cref="
Suppression
"/> items. It provides API to add a suppression, check if a passed-in suppression is already suppressed
19
private readonly HashSet<
Suppression
> _baselineSuppressions = [];
20
private readonly HashSet<
Suppression
> _suppressions = [];
27
public IReadOnlyCollection<
Suppression
> BaselineSuppressions => _baselineSuppressions;
30
public IReadOnlyCollection<
Suppression
> Suppressions => _suppressions;
41
if (serializer.Deserialize(reader) is
Suppression
[] deserializedSuppressions)
54
public bool IsErrorSuppressed(
Suppression
error)
71
Suppression
globalTargetSuppression = new(error.DiagnosticId, error.Target, isBaselineSuppression: error.IsBaselineSuppression);
74
Suppression
globalLeftRightSuppression = new(string.Empty, left: error.Left, right: error.Right, isBaselineSuppression: error.IsBaselineSuppression);
77
Suppression
globalDiagnosticIdLeftRightSuppression = new(error.DiagnosticId, left: error.Left, right: error.Right, isBaselineSuppression: error.IsBaselineSuppression);
86
if (_baselineSuppressions.TryGetValue(globalTargetSuppression, out
Suppression
? globalSuppression) ||
105
public void AddSuppression(
Suppression
suppression) => _suppressions.Add(suppression);
108
public (bool SuppressionFileUpdated, IReadOnlyCollection<
Suppression
> UpdatedSuppressions)
113
HashSet<
Suppression
> suppressionsToSerialize = new(_suppressions);
126
Suppression
[] orderedSuppressions = suppressionsToSerialize
156
public IReadOnlyCollection<
Suppression
> GetUnnecessarySuppressions() => _baselineSuppressions.Except(_suppressions).ToArray();
168
private static XmlSerializer CreateXmlSerializer() => new(typeof(
Suppression
[]), new XmlRootAttribute("Suppressions"));
Runner\ApiCompatRunner.cs (1)
68
Suppression
suppression = new(difference.DiagnosticId)