Enable CA1812 (#15674)

[CA1812: Avoid uninstantiated internal classes](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)
This commit is contained in:
xtqqczze
2021-06-27 20:16:17 +05:00
committed by GitHub
parent 1e992c5e53
commit b77bbf8640
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -346,7 +346,7 @@ dotnet_diagnostic.CA1810.severity = none
# CA1812: Avoid uninstantiated internal classes
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1812.severity = warning
# CA1813: Avoid unsealed attributes
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1813
@@ -4,6 +4,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Management.Automation;
@@ -159,6 +160,10 @@ namespace Microsoft.PowerShell.Commands.Utility
}
}
[SuppressMessage(
"Microsoft.Performance",
"CA1812:AvoidUninstantiatedInternalClasses",
Justification = "Class is instantiated through late-bound reflection")]
internal class JoinItemCompleter : IArgumentCompleter
{
public IEnumerable<CompletionResult> CompleteArgument(