Enable IDE0062: MakeLocalFunctionStatic (#14044)

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0062
This commit is contained in:
xtqqczze 2020-11-13 04:12:38 +00:00 committed by GitHub
parent 774d7d7891
commit 1dc0ba4a69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -911,7 +911,7 @@ dotnet_diagnostic.IDE0060.severity = silent
dotnet_diagnostic.IDE0061.severity = silent
# IDE0062: MakeLocalFunctionStatic
dotnet_diagnostic.IDE0062.severity = silent
dotnet_diagnostic.IDE0062.severity = warning
# IDE0063: UseSimpleUsingStatement
dotnet_diagnostic.IDE0063.severity = silent

View file

@ -1073,7 +1073,7 @@ namespace Microsoft.PowerShell
private bool ParseFile(string[] args, ref int i, bool noexitSeen)
{
// Try parse '$true', 'true', '$false' and 'false' values.
object ConvertToBoolIfPossible(string arg)
static object ConvertToBoolIfPossible(string arg)
{
// Before parsing we skip '$' if present.
return arg.Length > 0 && bool.TryParse(arg.AsSpan().Slice(arg[0] == '$' ? 1 : 0), out bool boolValue)

View file

@ -51,7 +51,7 @@ namespace System.Management.Automation
{
get
{
string GetFullName(string name, string psSnapInName, string moduleName)
static string GetFullName(string name, string psSnapInName, string moduleName)
{
string result = name;
if (!string.IsNullOrEmpty(psSnapInName))

View file

@ -1414,7 +1414,7 @@ namespace System.Management.Automation.Language
}
}
ExperimentalAttribute GetExpAttributeHelper(AttributeAst attributeAst)
static ExperimentalAttribute GetExpAttributeHelper(AttributeAst attributeAst)
{
AttributeAst potentialExpAttr = null;
string expAttrTypeName = typeof(ExperimentalAttribute).FullName;