Skip to content
Merged
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: 2 additions & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ dotnet_diagnostic.CA1050.severity = warning
dotnet_diagnostic.CA1051.severity = silent

# CA1052: Static holder types should be Static or NotInheritable
dotnet_diagnostic.CA1052.severity = none
dotnet_diagnostic.CA1052.severity = warning
dotnet_code_quality.ca1052.api_surface = private, internal

# CA1054: URI-like parameters should not be strings
dotnet_diagnostic.CA1054.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,8 @@ protected void ThrowWin32Error()

#region Win32 interop helper

internal class NativeMethods
internal static class NativeMethods
{
/// <summary>
/// Private constructor to prevent instantiation.
/// </summary>
private NativeMethods()
{
}

#region Native DLL locations

private const string SetDynamicTimeZoneApiDllName = "api-ms-win-core-timezone-l1-1-0.dll";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,8 @@ private object CreateComObject()
/// <summary>
/// Native methods for dealing with COM objects.
/// </summary>
internal class NewObjectNativeMethods
internal static class NewObjectNativeMethods
{
private NewObjectNativeMethods()
{
}

/// Return Type: HRESULT->LONG->int
[DllImport(PinvokeDllNames.CLSIDFromProgIDDllName)]
internal static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string lpszProgID, out Guid pclsid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void Dispose()
Dispose();
}

private class PropVariantNativeMethods
private static class PropVariantNativeMethods
{
[DllImport("Ole32.dll", PreserveSig = false)]
internal static extern void PropVariantClear([In, Out] PropVariant pvar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace System.Diagnostics.Eventing.Reader
{
internal class NativeWrapper
internal static class NativeWrapper
{
public class SystemProperties
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace System.Management.Automation
{
internal class NTVerpVars
internal static class NTVerpVars
{
internal const int PRODUCTMAJORVERSION = 10;
internal const int PRODUCTMINORVERSION = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/CoreCLR/CorePsStub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public static bool TryBindInvokeMember(InvokeMemberBinder binder, bool isSetProp
}
}

internal class VarEnumSelector
internal static class VarEnumSelector
{
internal static Type GetTypeForVarEnum(VarEnum vt)
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/COM/ComUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System.Management.Automation
/// <summary>
/// Defines a utility class that is used by COM adapter.
/// </summary>
internal class ComUtil
internal static class ComUtil
{
// HResult error code '-2147352573' - Member not found.
internal const int DISP_E_MEMBERNOTFOUND = unchecked((int)0x80020003);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected override void ProcessRecord()
}
}

internal class ExperimentalFeatureConfigHelper
internal static class ExperimentalFeatureConfigHelper
{
internal static void UpdateConfig(PSCmdlet cmdlet, string[] name, ConfigScope scope, bool enable)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace System.Management.Automation.Runspaces
{
internal class EarlyStartup
internal static class EarlyStartup
{
internal static void Init()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace System.Management.Automation
/// Changes to these type of modules will not be re-analyzed, unless the user re-imports the module,
/// or runs Get-Module -List.
/// </summary>
internal class AnalysisCache
internal static class AnalysisCache
{
private static readonly AnalysisCacheData s_cacheData = AnalysisCacheData.Get();

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

namespace System.Management.Automation
{
internal class RemoteDiscoveryHelper
internal static class RemoteDiscoveryHelper
{
#region PSRP

Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/MshMemberInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3670,7 +3670,7 @@ public override PSMemberInfo Copy()
/// <summary>
/// /// This class is used in PSMemberInfoInternalCollection and ReadOnlyPSMemberInfoCollection.
/// </summary>
internal class MemberMatch
internal static class MemberMatch
{
internal static WildcardPattern GetNamePattern(string name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal interface IInspectable { }
/// <summary>
/// Helper class for WinRT types.
/// </summary>
internal class WinRTHelper
internal static class WinRTHelper
{
internal static bool IsWinRTType(Type type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ internal static Type MakeDelegate(Type[] types)
}
}

internal class ScriptingRuntimeHelpers
internal static class ScriptingRuntimeHelpers
{
internal static object Int32ToObject(int i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/parser/PSType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace System.Management.Automation.Language
{
internal class TypeDefiner
internal static class TypeDefiner
{
internal const string DynamicClassAssemblyName = "PowerShell Class Assembly";
internal const string DynamicClassAssemblyFullNamePrefix = "PowerShell Class Assembly,";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ public override int GetHashCode()
}
}

internal class TypeCache
internal static class TypeCache
{
private class KeyComparer : IEqualityComparer<Tuple<ITypeName, TypeResolutionState>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ protected override void ProcessRecord()
/// <summary>
/// Utility methods for configuration file commands.
/// </summary>
internal class SessionConfigurationUtils
internal static class SessionConfigurationUtils
{
/// <summary>
/// This routine builds a fragment of the config file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace System.Management.Automation.Remoting
/// guarantees that transmitting on the wire will not change the encoded
/// object's type.
/// </summary>
internal class RemoteHostEncoder
internal static class RemoteHostEncoder
{
/// <summary>
/// Is known type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ internal static DynamicMetaObject UpdateComRestrictionsForPsObject(this DynamicM
}
}

internal class BinderUtils
internal static class BinderUtils
{
internal static BindingRestrictions GetVersionCheck(DynamicMetaObjectBinder binder, int expectedVersionNumber)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ internal static string CheckSuspiciousContent(Ast scriptBlockAst)
return null;
}

private class SuspiciousContentChecker
private static class SuspiciousContentChecker
{
// Based on a (bad) random number generator, but good enough
// for our simple needs.
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/help/CabinetAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ internal abstract class ICabinetExtractorLoader
/// <summary>
/// Used to create a CabinetExtractor class.
/// </summary>
internal class CabinetExtractorFactory
internal static class CabinetExtractorFactory
{
private static readonly ICabinetExtractorLoader s_cabinetLoader;
internal static readonly ICabinetExtractor EmptyExtractor = new EmptyCabinetExtractor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public int Compare(object x, object y)
/// is present in the box. This class mimics the exact same structure as that of a MAML
/// node, so that the default UX does not introduce regressions.
/// </summary>
internal class DefaultCommandHelpObjectBuilder
internal static class DefaultCommandHelpObjectBuilder
{
internal static readonly string TypeNameForDefaultHelp = "ExtendedCmdletHelpInfo";
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/help/HelpUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace System.Management.Automation
{
internal class HelpUtils
internal static class HelpUtils
{
private static string userHomeHelpPath = null;

Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/help/MamlUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace System.Management.Automation
/// <summary>
/// The MamlUtil class.
/// </summary>
internal class MamlUtil
internal static class MamlUtil
{
/// <summary>
/// Takes Name value from maml2 and overrides it in maml1.
Expand Down
4 changes: 2 additions & 2 deletions src/System.Management.Automation/security/SecuritySupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ public enum ResolutionPurpose
Decryption
}

internal class AmsiUtils
internal static class AmsiUtils
{
private static string GetProcessHostName(string processName)
{
Expand Down Expand Up @@ -1581,7 +1581,7 @@ internal static void WinUninitialize()
public static bool AmsiInitialized = false;
public static bool AmsiCleanedUp = false;

internal class AmsiNativeMethods
internal static class AmsiNativeMethods
{
internal enum AMSI_RESULT
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/security/nativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace System.Management.Automation.Security
{
// Crypto API native constants
internal partial class NativeConstants
internal static partial class NativeConstants
{
internal const int CRYPT_OID_INFO_OID_KEY = 1;
internal const int CRYPT_OID_INFO_NAME_KEY = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ internal static string DumpLockdownState(uint pdwLockdownState)
/// <summary>
/// Native constants for dealing with the lockdown policy.
/// </summary>
internal class WldpNativeConstants
internal static class WldpNativeConstants
{
internal const uint WLDP_HOST_INFORMATION_REVISION = 0x00000001;

Expand Down Expand Up @@ -541,7 +541,7 @@ internal struct WLDP_HOST_INFORMATION
/// <summary>
/// Native methods for dealing with the lockdown policy.
/// </summary>
internal class WldpNativeMethods
internal static class WldpNativeMethods
{
/// Return Type: HRESULT->LONG->int
/// pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION*
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/utils/PlatformInvokes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Management.Automation
{
internal class PlatformInvokes
internal static class PlatformInvokes
{
[StructLayout(LayoutKind.Sequential)]
internal class FILETIME
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/utils/PsUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ internal static object[] Base64ToArgsConverter(string base64)
/// A simple implementation of CRC32.
/// See "CRC-32 algorithm" in https://en.wikipedia.org/wiki/Cyclic_redundancy_check.
/// </summary>
internal class CRC32Hash
internal static class CRC32Hash
{
// CRC-32C polynomial representations
private const uint polynomial = 0x1EDC6F41;
Expand Down