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