Skip to content

Commit

Permalink
Enable new CA1839 and CA1840 Environment rules (#49393)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Mar 11, 2021
1 parent d67c5a1 commit 877a8df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions eng/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
<Rule Id="CA1836" Action="Warning" /> <!-- Prefer IsEmpty over Count -->
<Rule Id="CA1837" Action="Warning" /> <!-- Use 'Environment.ProcessId' -->
<Rule Id="CA1838" Action="Warning" /> <!-- Avoid 'StringBuilder' parameters for P/Invokes -->
<Rule Id="CA1839" Action="Warning" /> <!-- Use 'Environment.ProcessPath' -->
<Rule Id="CA1840" Action="Warning" /> <!-- Use 'Environment.CurrentManagedThreadId' -->
<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="Warning" /> <!-- Consider calling ConfigureAwait on the awaited task -->
Expand Down
5 changes: 5 additions & 0 deletions eng/CodeAnalysis.test.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
<Rule Id="CA1836" Action="None" /> <!-- Prefer IsEmpty over Count -->
<Rule Id="CA1837" Action="None" /> <!-- Use 'Environment.ProcessId' -->
<Rule Id="CA1838" Action="None" /> <!-- Avoid 'StringBuilder' parameters for P/Invokes -->
<Rule Id="CA1839" Action="None" /> <!-- Use 'Environment.ProcessPath' -->
<Rule Id="CA1840" Action="None" /> <!-- Use 'Environment.CurrentManagedThreadId' -->
<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 @@ -484,6 +486,9 @@
<Rule Id="IDE0082" Action="Hidden" /> <!-- ConvertTypeOfToNameOf -->
<Rule Id="IDE0083" Action="Hidden" /> <!-- UseNotPattern -->
<Rule Id="IDE0084" Action="Hidden" /> <!-- UseIsNotExpression -->
<Rule Id="IDE0090" Action="Hidden" /> <!-- UseNew -->
<Rule Id="IDE0100" Action="Hidden" /> <!-- RemoveRedundantEquality -->
<Rule Id="IDE0110" Action="Hidden" /> <!-- RemoveUnnecessaryDiscard -->
<Rule Id="IDE1001" Action="Hidden" /> <!-- AnalyzerChanged -->
<Rule Id="IDE1002" Action="Hidden" /> <!-- AnalyzerDependencyConflict -->
<Rule Id="IDE1003" Action="Hidden" /> <!-- MissingAnalyzerReference -->
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<ProjectServicingConfiguration Include="Microsoft.NETCore.App.Ref" PatchVersion="0" />
</ItemGroup>
<PropertyGroup>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview3.21123.3</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-preview3.21158.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.9.0-5.final</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisCSharpVersion>3.9.0-5.final</MicrosoftCodeAnalysisCSharpVersion>
<!-- Arcade dependencies -->
Expand Down

0 comments on commit 877a8df

Please sign in to comment.