Skip to content

[StyleCleanUp] Avoid legacy suppression format, use GlobalSuppressions (IDE0077) #10668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Microsoft.DotNet.Wpf/src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ dotnet_diagnostic.IDE0074.severity = suggestion
# IDE0075: Simplify conditional expression
dotnet_diagnostic.IDE0075.severity = suggestion

# IDE0077: Avoid legacy global suppression format
dotnet_diagnostic.IDE0077.severity = suggestion

# IDE0078: Use pattern matching
dotnet_diagnostic.IDE0078.severity = suggestion

Expand Down
106 changes: 49 additions & 57 deletions src/Microsoft.DotNet.Wpf/src/System.Xaml/GlobalSuppressions.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Compile Include="MS\Internal\Automation\ClickablePoint.cs" />
<Compile Include="MS\Internal\Automation\ClientEventManager.cs" />
<Compile Include="MS\Internal\Automation\ClientSideQueueItem.cs" />
<Compile Include="MS\Internal\Automation\CodeQuality_Approved.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="MS\Internal\Automation\EventListener.cs" />
<Compile Include="MS\Internal\Automation\EventListenerClientSide.cs" />
<Compile Include="MS\Internal\Automation\FocusTracker.cs" />
Expand Down

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</Compile>
<Compile Include="MS\Internal\AutomationProxies\Accessible.cs" />
<Compile Include="MS\Internal\AutomationProxies\ClickablePoint.cs" />
<Compile Include="MS\Internal\AutomationProxies\CodeQuality_Approved.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="MS\Internal\AutomationProxies\CommonGetThemePartSize.cs" />
<Compile Include="MS\Internal\AutomationProxies\CommonRemoteMemoryBlock.cs" />
<Compile Include="MS\Internal\AutomationProxies\CommonXSendMessage.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Diagnostics.CodeAnalysis;

[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Automation.TextPatternIdentifiers.OverlineStyleAttribute" )]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Automation.TextPatternIdentifiers.OverlineColorAttribute" )]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Automation.AutomationElementIdentifiers.IsOffscreenProperty" )]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~F:System.Windows.Automation.TextPatternIdentifiers.OverlineStyleAttribute")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~F:System.Windows.Automation.TextPatternIdentifiers.OverlineColorAttribute")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~F:System.Windows.Automation.AutomationElementIdentifiers.IsOffscreenProperty")]
// Approved by avsec.
[module: SuppressMessage("Microsoft.MSInternal", "CA900:AptcaAssembliesShouldBeReviewed")]
// The rule doesn't apply to non-public namespaces
[module: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "MS.Internal")]
[module: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "MS.Win32")]
[module: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "~N:MS.Internal")]
[module: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "~N:MS.Win32")]
// Reviewed by WinFX team and this case is OK
[module: SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "type", Target = "System.Windows.Automation.Text.FlowDirections")]
[module: SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "type", Target = "~T:System.Windows.Automation.Text.FlowDirections")]
// Reviewed by atgarch and these enums are OK
[module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "System.Windows.Automation.TreeScope")]
[module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "System.Windows.Automation.SupportedTextSelection")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Rect.Offset(System.Windows.Rect,System.Double,System.Double):System.Windows.Rect")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Rect.Offset(System.Double,System.Double):System.Void")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Point.Offset(System.Double,System.Double):System.Void")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.Windows.Automation.Text.CapStyle.Unicase")]
[module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "~T:System.Windows.Automation.TreeScope")]
[module: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "~T:System.Windows.Automation.SupportedTextSelection")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~M:System.Windows.Rect.Offset(System.Windows.Rect,System.Double,System.Double)~System.Windows.Rect")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~M:System.Windows.Rect.Offset(System.Double,System.Double)")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~M:System.Windows.Point.Offset(System.Double,System.Double)")]
[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "~F:System.Windows.Automation.Text.CapStyle.Unicase")]

[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "ExceptionStringTable.resources", MessageId = "classname")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "ExceptionStringTable.resources", MessageId = "imagename")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "StringTable.resources", MessageId = "dataitem")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "StringTable.resources", MessageId = "datagrid")]
// Reviewed and these are correctly suffixed
[module: SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Scope = "type", Target = "System.Windows.Automation.AutomationTextAttribute")]
[module: SuppressMessage("Microsoft.Design", "CA1036:OverrideMethodsOnComparableTypes", Scope = "type", Target = "System.Windows.Automation.AutomationIdentifier")]
[module: SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Scope = "type", Target = "~T:System.Windows.Automation.AutomationTextAttribute")]
[module: SuppressMessage("Microsoft.Design", "CA1036:OverrideMethodsOnComparableTypes", Scope = "type", Target = "~T:System.Windows.Automation.AutomationIdentifier")]
// Not required for non-public code
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "System.Windows.Automation")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "System.Windows.Automation.Provider")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "System.Windows.Input")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "System.Windows.Automation.Text")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "System.Windows.Automation")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "~N:System.Windows.Automation")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "~N:System.Windows.Automation.Provider")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "~N:System.Windows.Input")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "~N:System.Windows.Automation.Text")]
[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "namespace", Target = "~N:System.Windows.Automation")]

// The method uses a large switch as a covertion table. Safe to exclude.
[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope="member", Target="System.Windows.Input.KeyInterop.KeyFromVirtualKey(System.Int32):System.Windows.Input.Key")]
[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope="member", Target="System.Windows.Input.KeyInterop.VirtualKeyFromKey(System.Windows.Input.Key):System.Int32")]
[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "~M:System.Windows.Input.KeyInterop.KeyFromVirtualKey(System.Int32)~System.Windows.Input.Key")]
[module: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "~M:System.Windows.Input.KeyInterop.VirtualKeyFromKey(System.Windows.Input.Key)~System.Int32")]

//**************************************************************************************************************************
// Non hyphenated words are Microsoft style.
//***************************************************************************************************************************
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope="resource", Target="ExceptionStringTable.resources", MessageId="nonenabled")]
[module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "ExceptionStringTable.resources", MessageId = "nonenabled")]
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Compile Include="$(WpfSharedDir)\MS\Win32\NativeMethodsSetLastError.cs" />
<Compile Include="$(WpfSharedDir)\MS\Win32\UnsafeNativeMethodsCLR.cs" />
<Compile Include="MS\Internal\Automation\AutomationIdentifierConstants.cs" />
<Compile Include="MS\Internal\Automation\CodeQuality_Approved.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="MS\Internal\Automation\UiaCoreTypesApi.cs" />
<Compile Include="System\Windows\Automation\ActiveTextPositionChangedEventArgs.cs" />
<Compile Include="System\Windows\Automation\AsyncContentLoadedEventArgs.cs" />
Expand Down