Skip to content

[StyleCleanUp] Static holder types should be static or sealed (CA1052) #10718

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 @@ -17,9 +17,6 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# CA1036: Override methods on comparable types
dotnet_diagnostic.CA1036.severity = suggestion

# CA1052: Static holder types should be Static or NotInheritable
dotnet_diagnostic.CA1052.severity = suggestion

# NOTE: If existing public API, CA1066 should be suppressed individually
# in the GlobalSuppressions file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ internal enum MILCMD
#endif
};

internal partial class DUCE
internal static partial class DUCE
{
//
// The MILCE resource type enumeration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


Expand All @@ -14,7 +14,7 @@ namespace MS.Win32.Pointer
/// For WM_POINTER <see cref="https://msdn.microsoft.com/en-us/library/windows/desktop/hh454916(v=vs.85).aspx"/>
/// For InteractionContext <see cref="https://msdn.microsoft.com/en-us/library/windows/desktop/hh448840(v=vs.85).aspx"/>
/// </summary>
internal class UnsafeNativeMethods
internal static class UnsafeNativeMethods
{
#region Enumerations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//#define OLD_ISF

namespace MS.Internal.Ink.InkSerializedFormat
{
internal class Compressor
internal static class Compressor
#if OLD_ISF
: IDisposable
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace MS.Internal
Expand All @@ -25,7 +25,7 @@ internal class MediaTrace : IDisposable
public static MediaTrace QueueItems = new MediaTrace("MILQueueItems");
public static MediaTrace Statistics = new MediaTrace("Statistics");

public class ChangeQueue
public static class ChangeQueue
{
public static MediaTrace ApplyChange = new MediaTrace("Change queue: Apply Change");
public static MediaTrace Enqueue = new MediaTrace("Change queue: Enqueue");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


Expand All @@ -9,7 +9,7 @@ namespace System.Windows.Input.StylusPointer
/// <summary>
/// Contains a WM_POINTER specific functions to parse out stylus property info
/// </summary>
internal class PointerStylusPointPropertyInfoHelper
internal static class PointerStylusPointPropertyInfoHelper
{
#region Constants

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,9 @@ namespace MS.Internal.Annotations.Anchoring
/// represent these TextAnchors and can generate TextAnchors from
/// the locator parts.
/// </summary>
internal class TextSelectionHelper
internal static class TextSelectionHelper
{
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------

#region Constructors

/// <summary>
/// This ctor is added to prevent the compiler from
/// generating a public default ctor. This class
/// should not be instantiated
/// </summary>
private TextSelectionHelper() { }

#endregion Constructors

//------------------------------------------------------
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//
Expand All @@ -19,7 +19,7 @@ namespace MS.Internal.Controls
// It also has types that make sense only for ActiveX hosting classes.
// In other words, this is a helper class for the ActiveX hosting classes.
//
internal class ActiveXHelper
internal static class ActiveXHelper
{
//
// Types:
Expand Down Expand Up @@ -56,11 +56,6 @@ public enum ActiveXState
private static int logPixelsY = -1;
private const int HMperInch = 2540;

// Prevent compiler from generating public CTOR
private ActiveXHelper()
{
}

//
// Static helper methods:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ internal static Exception GetExceptionForHR(this Exception innerException, int h
}
}

internal class ErrorStrings
internal static class ErrorStrings
{
internal static string Format(string format, params object[] args) => String.Format(format, args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public static unsafe void DisposeAbiArray(object box)
}
}

internal class MarshalInterfaceHelper<T>
internal static class MarshalInterfaceHelper<T>
{
internal struct MarshalerArray
{
Expand Down Expand Up @@ -974,7 +974,7 @@ public static unsafe void CopyManaged(object o, IntPtr dest, bool unwrapObject =
public static unsafe void DisposeAbiArray(object box) => MarshalInterfaceHelper<object>.DisposeAbiArray(box);
}

internal class Marshaler<T>
internal static class Marshaler<T>
{
static Marshaler()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace System.Windows.Documents
{
namespace MsSpellCheckLib
{
internal class RCW
internal static class RCW
{
#region WORDLIST_TYPE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//
Expand All @@ -16,22 +16,8 @@ namespace System.Windows.Documents
// TextTreeDumper.DumpTree(texttree);
// TextTreeDumper.DumpNode(someNode);
//
internal class TextTreeDumper
internal static class TextTreeDumper
{
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------

#region Constructors

// Static class.
private TextTreeDumper()
{
}

#endregion Constructors

//------------------------------------------------------
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace System.Windows.Markup
{
internal class WpfXamlLoader
internal static class WpfXamlLoader
{
private static Lazy<XamlMember> XmlSpace = new Lazy<XamlMember>(() => new WpfXamlMember(XmlAttributeProperties.XmlSpaceProperty, true));

Expand Down
Loading
Loading