diff --git a/.globalconfig b/.globalconfig index cdddd9f2630..3e2927f6838 100644 --- a/.globalconfig +++ b/.globalconfig @@ -844,7 +844,7 @@ dotnet_diagnostic.IDE0038.severity = silent dotnet_diagnostic.IDE0039.severity = silent # IDE0040: AddAccessibilityModifiers -dotnet_diagnostic.IDE0040.severity = silent +dotnet_diagnostic.IDE0040.severity = warning # IDE0041: UseIsNullCheck dotnet_diagnostic.IDE0041.severity = silent diff --git a/src/System.Management.Automation/engine/PSConfiguration.cs b/src/System.Management.Automation/engine/PSConfiguration.cs index aacf5c50e32..ade427b2154 100644 --- a/src/System.Management.Automation/engine/PSConfiguration.cs +++ b/src/System.Management.Automation/engine/PSConfiguration.cs @@ -290,12 +290,12 @@ internal PSLevel GetLogLevel() /// /// The supported separator characters for listing channels and keywords in configuration. /// - static readonly char[] s_valueSeparators = new char[] {' ', ',', '|'}; + private static readonly char[] s_valueSeparators = new char[] {' ', ',', '|'}; /// /// Provides a string name to indicate the default for a configuration setting. /// - const string LogDefaultValue = "default"; + private const string LogDefaultValue = "default"; /// /// Gets the bitmask of the PSChannel values to log. diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index 5796bd22159..633c320b7af 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -80,11 +80,12 @@ namespace System.Management.Automation.Tracing internal class SysLogProvider { // Ensure the string pointer is not garbage collected. - static IntPtr _nativeSyslogIdent = IntPtr.Zero; - static readonly NativeMethods.SysLogPriority _facility = NativeMethods.SysLogPriority.Local0; - readonly byte _channelFilter; - readonly ulong _keywordFilter; - readonly byte _levelFilter; + private static IntPtr _nativeSyslogIdent = IntPtr.Zero; + private static readonly NativeMethods.SysLogPriority _facility = NativeMethods.SysLogPriority.Local0; + + private readonly byte _channelFilter; + private readonly ulong _keywordFilter; + private readonly byte _levelFilter; /// /// Initializes a new instance of this class. @@ -147,7 +148,7 @@ private static StringBuilder MessageBuilder /// to ensure correct thread initialization. /// [ThreadStatic] - static Guid? t_activity; + private static Guid? t_activity; private static Guid Activity { @@ -275,7 +276,7 @@ private static void GetEventMessage(StringBuilder sb, PSEventId eventId, params #region logging // maps a LogLevel to an associated SysLogPriority. - static readonly NativeMethods.SysLogPriority[] _levels = + private static readonly NativeMethods.SysLogPriority[] _levels = { NativeMethods.SysLogPriority.Info, NativeMethods.SysLogPriority.Critical, @@ -374,7 +375,7 @@ internal enum LogLevel : uint internal static class NativeMethods { - const string libpslnative = "libpsl-native"; + private const string libpslnative = "libpsl-native"; /// /// Write a message to the system logger, which in turn writes the message to the system console, log files, etc. /// See man 3 syslog for more info. diff --git a/test/tools/TestExe/TestExe.cs b/test/tools/TestExe/TestExe.cs index 1293a4acaee..c8f91d4d38e 100644 --- a/test/tools/TestExe/TestExe.cs +++ b/test/tools/TestExe/TestExe.cs @@ -7,9 +7,9 @@ namespace TestExe { - class TestExe + internal class TestExe { - static int Main(string[] args) + private static int Main(string[] args) { if (args.Length > 0) { @@ -44,7 +44,7 @@ static int Main(string[] args) // // Echos back to stdout the arguments passed in // - static void EchoArgs(string[] args) + private static void EchoArgs(string[] args) { for (int i = 1; i < args.Length; i++) { @@ -56,7 +56,7 @@ static void EchoArgs(string[] args) // First argument is the number of child processes to create which are instances of itself // Processes automatically exit after 100 seconds // - static void CreateChildProcess(string[] args) + private static void CreateChildProcess(string[] args) { if (args.Length > 1) { diff --git a/test/tools/TestService/Program.cs b/test/tools/TestService/Program.cs index 2e7a2ae1b42..83305624582 100644 --- a/test/tools/TestService/Program.cs +++ b/test/tools/TestService/Program.cs @@ -5,9 +5,9 @@ namespace TestService { - static class Program + internal static class Program { - static void Main() + private static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[]