Enable CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder (#13926)

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1830
This commit is contained in:
xtqqczze 2020-11-02 03:46:40 +00:00 committed by GitHub
parent fc15daaccb
commit 4b9f9dc457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -301,7 +301,7 @@ dotnet_diagnostic.CA1828.severity = suggestion
dotnet_diagnostic.CA1829.severity = suggestion
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = suggestion
dotnet_diagnostic.CA1830.severity = warning
# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1831.severity = warning

View File

@ -336,7 +336,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
{
// unKnowViewFormatStringBuilder.Append(StringUtil.Format(FormatAndOut_format_xxx.UnknownViewNameError, viewName));
unKnowViewFormatStringBuilder.Append(StringUtil.Format(FormatAndOut_format_xxx.UnknownViewNameErrorSuffix, viewName, formatTypeName));
unKnowViewFormatStringBuilder.Append(validViewFormats.ToString());
unKnowViewFormatStringBuilder.Append(validViewFormats);
}
else
{

View File

@ -873,7 +873,7 @@ namespace System.Management.Automation
builder.Append("System.Management.ManagementBaseObject ");
builder.Append(mData.Name);
builder.Append('(');
builder.Append(inParameterString.ToString());
builder.Append(inParameterString);
builder.Append(')');
string returnValue = builder.ToString();

View File

@ -441,7 +441,7 @@ namespace System.Management.Automation
if (exsb.Length > 0)
{
sb.Append("\n\n.EXAMPLE\n\n");
sb.Append(exsb.ToString());
sb.Append(exsb);
}
}
}