Skip to content

Use AnalysisMode=minimum in Microsoft.CodeAnalysis.NetAnalyzers and fix errors (perf rules)#50367

Closed
Alex-Sob wants to merge 3 commits intodotnet:mainfrom
Alex-Sob:dev/alex-sob/analysis-mode-minimum
Closed

Use AnalysisMode=minimum in Microsoft.CodeAnalysis.NetAnalyzers and fix errors (perf rules)#50367
Alex-Sob wants to merge 3 commits intodotnet:mainfrom
Alex-Sob:dev/alex-sob/analysis-mode-minimum

Conversation

@Alex-Sob
Copy link
Copy Markdown

@Alex-Sob Alex-Sob commented Aug 19, 2025

This PR is the first one in an effort to enable code analysis rules for code analyzers: #50365

Changes

  • Set AnalysisMode to Minimum in Microsoft.CodeAnalysis.NetAnalyzers project.

  • Fix the following errors which are performance rules:

    • 1822: Mark members as static
    • 1859: Use concrete types when possible for improved performance
    • 1860: Avoid using 'Enumerable.Any()' extension method
    • 1861: Avoid constant arrays as arguments

@Alex-Sob Alex-Sob requested a review from a team as a code owner August 19, 2025 15:27
@Alex-Sob Alex-Sob changed the title Use AnalysisMode=minimum in Microsoft.CodeAnalysis.NetAnalyzers and fix errors Use AnalysisMode=minimum in Microsoft.CodeAnalysis.NetAnalyzers and fix errors (perf rules) Aug 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants