Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update analyzer rulesets #55925

Merged
merged 1 commit into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
<Rule Id="CA2249" Action="Warning" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
<Rule Id="CA2250" Action="Warning" /> <!-- Use 'ThrowIfCancellationRequested' -->
<Rule Id="CA2251" Action="Warning" /> <!-- Use 'string.Equals' -->
<Rule Id="CA2252" Action="None" /> <!-- This API requires opting into preview features -->
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
<Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
<Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->
Expand Down Expand Up @@ -498,6 +499,8 @@
<Rule Id="IDE0110" Action="Hidden" /> <!-- RemoveUnnecessaryDiscard -->
<Rule Id="IDE0120" Action="Hidden" /> <!-- SimplifyLINQExpression -->
<Rule Id="IDE0130" Action="Hidden" /> <!-- NamespaceDoesNotMatchFolderStructure -->
<Rule Id="IDE0140" Action="Hidden" /> <!-- SimplifyObjectCreationDiagnosticId -->
<Rule Id="IDE0150" Action="Hidden" /> <!-- UseNullCheckOverTypeCheckDiagnosticId -->
<Rule Id="IDE1001" Action="Hidden" /> <!-- AnalyzerChanged -->
<Rule Id="IDE1002" Action="Hidden" /> <!-- AnalyzerDependencyConflict -->
<Rule Id="IDE1003" Action="Hidden" /> <!-- MissingAnalyzerReference -->
Expand Down
20 changes: 13 additions & 7 deletions eng/CodeAnalysis.test.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
<Rule Id="CA1401" Action="None" /> <!-- P/Invokes should not be visible -->
<Rule Id="CA1416" Action="None" /> <!-- Validate platform compatibility -->
<Rule Id="CA1417" Action="None" /> <!-- Do not use 'OutAttribute' on string parameters for P/Invokes -->
<Rule Id="CA1418" Action="None" /> <!-- Use valid platform string -->
<Rule Id="CA1419" Action="None" /> <!-- Provide a public parameterless constructor for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' -->
<Rule Id="CA1501" Action="None" /> <!-- Avoid excessive inheritance -->
<Rule Id="CA1502" Action="None" /> <!-- Avoid excessive complexity -->
<Rule Id="CA1505" Action="None" /> <!-- Avoid unmaintainable code -->
Expand Down Expand Up @@ -120,11 +122,12 @@
<Rule Id="CA1839" Action="None" /> <!-- Use 'Environment.ProcessPath' -->
<Rule Id="CA1840" Action="None" /> <!-- Use 'Environment.CurrentManagedThreadId' -->
<Rule Id="CA1841" Action="None" /> <!-- Prefer Dictionary.Contains methods -->
<Rule Id="CA1842" Action="None" /> <!-- Do not use 'WhenAll' with a single task -->
<Rule Id="CA1843" Action="None" /> <!-- Do not use 'WaitAll' with a single task -->
<Rule Id="CA1844" Action="None" /> <!-- Provide memory-based overrides of async methods when subclassing 'Stream' -->
<Rule Id="CA1845" Action="None" /> <!-- Use span-based 'string.Concat' -->
<Rule Id="CA1846" Action="None" /> <!-- Prefer 'AsSpan' over 'Substring' -->
<Rule Id="CA1842" Action="None" /> <!-- Do not use 'WhenAll' with a single task -->
<Rule Id="CA1843" Action="None" /> <!-- Do not use 'WaitAll' with a single task -->
<Rule Id="CA1844" Action="None" /> <!-- Provide memory-based overrides of async methods when subclassing 'Stream' -->
<Rule Id="CA1845" Action="None" /> <!-- Use span-based 'string.Concat' -->
<Rule Id="CA1846" Action="None" /> <!-- Prefer 'AsSpan' over 'Substring' -->
<Rule Id="CA1847" Action="None" /> <!-- Use char literal for a single character lookup -->
<Rule Id="CA2000" Action="None" /> <!-- Dispose objects before losing scope -->
<Rule Id="CA2002" Action="None" /> <!-- Do not lock on objects with weak identity -->
<Rule Id="CA2007" Action="None" /> <!-- Consider calling ConfigureAwait on the awaited task -->
Expand Down Expand Up @@ -172,7 +175,8 @@
<Rule Id="CA2248" Action="None" /> <!-- Provide correct 'enum' argument to 'Enum.HasFlag' -->
<Rule Id="CA2249" Action="None" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
<Rule Id="CA2250" Action="None" /> <!-- Use 'ThrowIfCancellationRequested' -->
<Rule Id="CA2251" Action="None" /> <!-- Use 'string.Equals' -->
<Rule Id="CA2251" Action="None" /> <!-- Use 'string.Equals' -->
<Rule Id="CA2252" Action="None" /> <!-- This API requires opting into preview features -->
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
<Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
<Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->
Expand Down Expand Up @@ -496,8 +500,10 @@
<Rule Id="IDE0090" Action="Hidden" /> <!-- UseNew -->
<Rule Id="IDE0100" Action="Hidden" /> <!-- RemoveRedundantEquality -->
<Rule Id="IDE0110" Action="Hidden" /> <!-- RemoveUnnecessaryDiscard -->
<Rule Id="IDE0120" Action="Hidden" /> <!-- SimplifyLINQExpression -->
<Rule Id="IDE0120" Action="Hidden" /> <!-- SimplifyLINQExpression -->
<Rule Id="IDE0130" Action="Hidden" /> <!-- NamespaceDoesNotMatchFolderStructure -->
<Rule Id="IDE0140" Action="Hidden" /> <!-- SimplifyObjectCreationDiagnosticId -->
<Rule Id="IDE0150" Action="Hidden" /> <!-- UseNullCheckOverTypeCheckDiagnosticId -->
<Rule Id="IDE1001" Action="Hidden" /> <!-- AnalyzerChanged -->
<Rule Id="IDE1002" Action="Hidden" /> <!-- AnalyzerDependencyConflict -->
<Rule Id="IDE1003" Action="Hidden" /> <!-- MissingAnalyzerReference -->
Expand Down