Skip to content

Commit

Permalink
Delete [SuppressMessage(...)] attributes for old/defunct/unused rules (
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Feb 9, 2020
1 parent a1bc3cc commit 3bb5f14
Show file tree
Hide file tree
Showing 264 changed files with 1 addition and 785 deletions.
1 change: 0 additions & 1 deletion src/libraries/Common/src/System/Drawing/KnownColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace System.Drawing
{
[SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
[TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#if NETCOREAPP2_0
internal
Expand Down
1 change: 0 additions & 1 deletion src/libraries/Common/tests/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public void Dispose()
/// <summary>Creates a new subkey, or opens an existing one.</summary>
/// <param name="subkey">Name or path to subkey to create or open.</param>
/// <returns>The subkey, or <b>null</b> if the operation failed.</returns>
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread safety")]
public RegistryKey CreateSubKey(string subkey)
{
return CreateSubKey(subkey, _checkMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private SystemEvents()

// stole from SystemInformation... if we get SystemInformation moved
// to somewhere that we can use it... rip this!
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
private static volatile IntPtr s_processWinStation = IntPtr.Zero;
private static volatile bool s_isUserInteractive = false;
private static unsafe bool UserInteractive
Expand Down Expand Up @@ -715,8 +714,6 @@ private unsafe void Initialize()
/// This empties this control's callback queue, propagating any exceptions
/// back as needed.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")]
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private void InvokeMarshaledCallbacks()
{
Debug.Assert(s_threadCallbackList != null, "Invoking marshaled callbacks before there are any");
Expand Down Expand Up @@ -998,8 +995,6 @@ private static void RaiseEvent(object key, params object[] args)
RaiseEvent(true, key, args);
}

[SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")]
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private static void RaiseEvent(bool checkFinalization, object key, params object[] args)
{
Debug.Assert(args != null && args.Length == 2);
Expand Down Expand Up @@ -1129,8 +1124,6 @@ private static void Shutdown(object? sender, EventArgs e)
/// <summary>
/// A standard Win32 window proc for our broadcast window.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")]
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
{
switch (msg)
Expand Down Expand Up @@ -1255,8 +1248,6 @@ private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
/// is made visible with a size of 0, 0, so that it will trap
/// global broadcast messages.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")]
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private void WindowThreadProc()
{
try
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\InternalsVisibleTo.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="System\Collections\Generic\IHashKeyCollection.cs" />
<Compile Include="System\Collections\Generic\ISortKeyCollection.cs" />
<Compile Include="System\Collections\Immutable\AllocFreeConcurrentStack.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace System.Collections.Generic
/// Defined on a generic collection that hashes its contents using an <see cref="IEqualityComparer{TKey}"/>.
/// </summary>
/// <typeparam name="TKey">The type of element hashed in the collection.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
internal interface IHashKeyCollection<in TKey>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace System.Collections.Generic
/// Defined on a generic collection that sorts its contents using an <see cref="IComparer{TKey}"/>.
/// </summary>
/// <typeparam name="TKey">The type of element sorted in the collection.</typeparam>
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
internal interface ISortKeyCollection<in TKey>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace System.Collections.Immutable
/// </summary>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <typeparam name="TValue">The type of the value.</typeparam>
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public interface IImmutableDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>
{
/// <summary>
Expand Down Expand Up @@ -42,7 +40,6 @@ public interface IImmutableDictionary<TKey, TValue> : IReadOnlyDictionary<TKey,
/// <param name="pairs">The pairs.</param>
/// <returns>The new dictionary containing the additional key-value pairs.</returns>
/// <exception cref="ArgumentException">Thrown when one of the given keys already exists in the dictionary but has a different value.</exception>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[Pure]
IImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs);

Expand All @@ -65,7 +62,6 @@ public interface IImmutableDictionary<TKey, TValue> : IReadOnlyDictionary<TKey,
/// <param name="items">The key=value pairs to set on the dictionary. Any keys that conflict with existing keys will overwrite the previous values.</param>
/// <returns>An immutable dictionary.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
IImmutableDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace System.Collections.Immutable
/// Mutations on this list generate new lists. Incremental changes to a list share as much memory as possible with the prior versions of a list,
/// while allowing garbage collection to clean up any unique list data that is no longer being referenced.
/// </remarks>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public interface IImmutableList<T> : IReadOnlyList<T>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ namespace System.Collections.Immutable
/// An immutable queue.
/// </summary>
/// <typeparam name="T">The type of elements in the queue.</typeparam>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")]
public interface IImmutableQueue<T> : IEnumerable<T>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace System.Collections.Immutable
/// Mutations on this set generate new sets. Incremental changes to a set share as much memory as possible with the prior versions of a set,
/// while allowing garbage collection to clean up any unique set data that is no longer being referenced.
/// </remarks>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")]
public interface IImmutableSet<T> : IReadOnlyCollection<T>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ namespace System.Collections.Immutable
/// An immutable stack.
/// </summary>
/// <typeparam name="T">The type of elements stored in the stack.</typeparam>
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public interface IImmutableStack<T> : IEnumerable<T>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace System.Collections.Immutable
/// <summary>
/// A set of initialization methods for instances of <see cref="ImmutableDictionary{TKey, TValue}"/>.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
public static class ImmutableDictionary
{
/// <summary>
Expand Down Expand Up @@ -66,7 +65,6 @@ public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityCo
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull
{
return ImmutableDictionary<TKey, TValue>.Empty.AddRange(items);
Expand All @@ -81,7 +79,6 @@ public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEnume
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull
{
return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer).AddRange(items);
Expand All @@ -97,7 +94,6 @@ public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqual
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull
{
return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(items);
Expand Down Expand Up @@ -250,7 +246,6 @@ public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, T
/// <param name="valueComparer">The value comparer to use for the immutable map.</param>
/// <returns>An immutable map.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
{
Requires.NotNull(source, nameof(source));
Expand All @@ -273,7 +268,6 @@ public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TVal
/// <param name="keyComparer">The key comparer to use when building the immutable map.</param>
/// <returns>An immutable map.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer) where TKey : notnull
{
return ToImmutableDictionary(source, keyComparer, null);
Expand All @@ -287,7 +281,6 @@ public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TVal
/// <param name="source">The sequence of key=value pairs.</param>
/// <returns>An immutable map.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source) where TKey : notnull
{
return ToImmutableDictionary(source, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace System.Collections.Immutable
/// <content>
/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Builder"/> class.
/// </content>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public sealed partial class ImmutableDictionary<TKey, TValue>
{
/// <summary>
Expand All @@ -29,8 +28,6 @@ public sealed partial class ImmutableDictionary<TKey, TValue>
/// Instance members of this class are <em>not</em> thread-safe.
/// </para>
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(ImmutableDictionaryBuilderDebuggerProxy<,>))]
public sealed class Builder : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IDictionary
Expand Down Expand Up @@ -435,7 +432,6 @@ public TValue this[TKey key]
/// Adds a sequence of values to this collection.
/// </summary>
/// <param name="items">The items.</param>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public void AddRange(IEnumerable<KeyValuePair<TKey, TValue>> items)
{
var result = ImmutableDictionary<TKey, TValue>.AddRange(items, this.Origin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public sealed partial class ImmutableDictionary<TKey, TValue> : IImmutableDictio
/// <summary>
/// An empty immutable dictionary with default equality comparers.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly ImmutableDictionary<TKey, TValue> Empty = new ImmutableDictionary<TKey, TValue>();

/// <summary>
Expand Down Expand Up @@ -313,7 +312,6 @@ public ImmutableDictionary<TKey, TValue> Add(TKey key, TValue value)
/// See the <see cref="IImmutableDictionary{TKey, TValue}"/> interface.
/// </summary>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public ImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
{
Requires.NotNull(pairs, nameof(pairs));
Expand All @@ -339,7 +337,6 @@ public ImmutableDictionary<TKey, TValue> SetItem(TKey key, TValue value)
/// <param name="items">The key=value pairs to set on the map. Any keys that conflict with existing keys will overwrite the previous values.</param>
/// <returns>An immutable dictionary.</returns>
[Pure]
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public ImmutableDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)
{
Requires.NotNull(items, nameof(items));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace System.Collections.Immutable
/// <content>
/// Contains the inner <see cref="ImmutableHashSet{T}.Builder"/> class.
/// </content>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public sealed partial class ImmutableHashSet<T>
{
/// <summary>
Expand All @@ -28,8 +27,6 @@ public sealed partial class ImmutableHashSet<T>
/// Instance members of this class are <em>not</em> thread-safe.
/// </para>
/// </remarks>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")]
[DebuggerDisplay("Count = {Count}")]
public sealed class Builder : IReadOnlyCollection<T>, ISet<T>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public sealed partial class ImmutableHashSet<T> : IImmutableSet<T>, IHashKeyColl
/// <summary>
/// An empty immutable hash set with the default comparer for <typeparamref name="T"/>.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly ImmutableHashSet<T> Empty = new ImmutableHashSet<T>(SortedInt32KeyNode<HashBucket>.EmptyNode, EqualityComparer<T>.Default, 0);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace System.Collections.Immutable
/// <content>
/// Contains the inner Builder class.
/// </content>
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
public sealed partial class ImmutableList<T>
{
/// <summary>
Expand All @@ -29,8 +28,6 @@ public sealed partial class ImmutableList<T>
/// Instance members of this class are <em>not</em> thread-safe.
/// </para>
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")]
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(ImmutableListBuilderDebuggerProxy<>))]
public sealed class Builder : IList<T>, IList, IOrderedCollection<T>, IImmutableListQueries<T>, IReadOnlyList<T>
Expand Down Expand Up @@ -130,7 +127,6 @@ private set
/// </summary>
/// <param name="index">The index of the desired element.</param>
/// <returns>The value at the specified index.</returns>
[SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "index+1", Justification = "There is no chance of this overflowing")]
public T this[int index]
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public sealed partial class ImmutableList<T> : IImmutableList<T>, IList<T>, ILis
/// <summary>
/// An empty immutable list.
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly ImmutableList<T> Empty = new ImmutableList<T>();

/// <summary>
Expand Down
Loading

0 comments on commit 3bb5f14

Please sign in to comment.