Enable IDE0040: AddAccessibilityModifiers (#13962)

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0040
This commit is contained in:
xtqqczze 2020-11-09 04:37:25 +00:00 committed by GitHub
parent ed595c0406
commit 23deb41f49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 17 deletions

View file

@ -845,7 +845,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

View file

@ -290,12 +290,12 @@ namespace System.Management.Automation.Configuration
/// <summary>
/// The supported separator characters for listing channels and keywords in configuration.
/// </summary>
static readonly char[] s_valueSeparators = new char[] {' ', ',', '|'};
private static readonly char[] s_valueSeparators = new char[] {' ', ',', '|'};
/// <summary>
/// Provides a string name to indicate the default for a configuration setting.
/// </summary>
const string LogDefaultValue = "default";
private const string LogDefaultValue = "default";
/// <summary>
/// Gets the bitmask of the PSChannel values to log.

View file

@ -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;
/// <summary>
/// Initializes a new instance of this class.
@ -147,7 +148,7 @@ namespace System.Management.Automation.Tracing
/// to ensure correct thread initialization.
/// </remarks>
[ThreadStatic]
static Guid? t_activity;
private static Guid? t_activity;
private static Guid Activity
{
@ -275,7 +276,7 @@ namespace System.Management.Automation.Tracing
#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 @@ namespace System.Management.Automation.Tracing
internal static class NativeMethods
{
const string libpslnative = "libpsl-native";
private const string libpslnative = "libpsl-native";
/// <summary>
/// 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.

View file

@ -7,9 +7,9 @@ using System.Diagnostics;
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 @@ namespace TestExe
// <Summary>
// Echos back to stdout the arguments passed in
// </Summary>
static void EchoArgs(string[] args)
private static void EchoArgs(string[] args)
{
for (int i = 1; i < args.Length; i++)
{
@ -56,7 +56,7 @@ namespace TestExe
// First argument is the number of child processes to create which are instances of itself
// Processes automatically exit after 100 seconds
// </Summary>
static void CreateChildProcess(string[] args)
private static void CreateChildProcess(string[] args)
{
if (args.Length > 1)
{

View file

@ -5,9 +5,9 @@ using System.ServiceProcess;
namespace TestService
{
static class Program
internal static class Program
{
static void Main()
private static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]