mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 09:43:57 +08:00
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:
parent
fc15daaccb
commit
4b9f9dc457
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user