Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
75cbd6a
Enforce release-tracking consistency via Microsoft.CodeAnalysis.Analy…
tannergooding Jul 29, 2026
d3704a7
Fix the Documentation links in release tracking
tannergooding Jul 29, 2026
519129f
Validate release-tracking documentation links when generating the docs
tannergooding Jul 29, 2026
1fe882d
Add [Shared] to 12 CodeFixProviders missing it
tannergooding Jul 29, 2026
ee657d9
Look up and compare well-known types through WellKnownTypeProvider
tannergooding Jul 29, 2026
3e946b7
Use nameof for equivalenceKey in TestForEmptyStringsUsingStringLength…
tannergooding Jul 29, 2026
52e757d
Make the CA5404 property-name set static readonly
tannergooding Jul 29, 2026
7b1f565
Cache SupportedDiagnostics and FixableDiagnosticIds instead of rebuil…
tannergooding Jul 30, 2026
64b4f83
Remove 79 exported code fixers that never register a fix
tannergooding Jul 30, 2026
f8d73e6
Read arguments by parameter ordinal in the CA2208 and CA1421 fixers
tannergooding Jul 30, 2026
e998e05
Move the code fixers off the batch fixer onto the shared fix-all prov…
tannergooding Jul 30, 2026
fea0fdb
Fix CA1835 fix-all dropping a nested stream call
tannergooding Jul 30, 2026
cfe7ca0
Fix CA2028 fix-all dropping a fix when guarded ifs nest
tannergooding Jul 30, 2026
02b4287
Fix CA1854/CA1864 fix-all introducing duplicate locals for nested guards
tannergooding Jul 30, 2026
399cca5
Fix CA1845 fix-all not converging on nested concatenations
tannergooding Jul 30, 2026
14f514c
Fix CA1870 fix-all not converging on multiple IndexOfAny calls
tannergooding Jul 30, 2026
001673d
Cover fix-all for CA1862, CA1866 and CA2250
tannergooding Jul 30, 2026
704b6eb
Use async Task + await in test methods per authoring guidance
tannergooding Jul 31, 2026
7c71552
Fix async/await errors in test helpers and expression-body methods
tannergooding Jul 31, 2026
59bd89a
Add missing async to 5 Task-returning test methods
tannergooding Jul 31, 2026
6e02181
Fix async test branch fallthrough
tannergooding Jul 31, 2026
ea2de97
Merge dotnet/main into tannergooding-analyzer-conformance-sweep
tannergooding Aug 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Contracts" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="$(MicrosoftCodeAnalysisPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion)" />
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<SystemDataSqlClientPackageVersion>4.8.6</SystemDataSqlClientPackageVersion>
<WebDeploymentPackageVersion>4.0.5</WebDeploymentPackageVersion>
<SystemCommandLineNamingConventionBinderVersion>2.0.0-beta5.25279.2</SystemCommandLineNamingConventionBinderVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>5.10.0-1.26363.117</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.2</MicrosoftCodeAnalysisAnalyzerTestingVersion>
<MicrosoftVisualBasicVersion>10.3.0</MicrosoftVisualBasicVersion>
<MicrosoftVisualStudioSetupConfigurationInteropVersion>3.2.2146</MicrosoftVisualStudioSetupConfigurationInteropVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Rules with no code fix

These rules report a diagnostic and leave the user to fix it by hand. The list is here so
that a rule wanting a fixer is discoverable rather than something you find out by grepping
for one that is not there.

Adding a fixer for any of these is self-contained work;
[`netcore-getting-started.md`](netcore-getting-started.md) covers the mechanics. Delete the
row when the fixer lands.

A fixer is not automatically the right answer. Where applying one could change semantics,
the rule should keep reporting without it - decide that before writing code. Do not export a
placeholder that registers nothing: the generated rule table reports `CodeFix: True` for any
rule with an exported fixer, so an empty one advertises a fix that never appears.

## Shipping rules (33)

| Rule | Title | Category |
|------|-------|----------|
| [CA1010](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1010) | Generic interface should also be implemented | Design |
| [CA1014](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1014) | Mark assemblies with CLSCompliant | Design |
| [CA1016](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1016) | Mark assemblies with assembly version | Design |
| [CA1017](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1017) | Mark assemblies with ComVisible | Design |
| [CA1024](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1024) | Use properties where appropriate | Design |
| [CA1030](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1030) | Use events where appropriate | Design |
| [CA1040](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1040) | Avoid empty interfaces | Design |
| [CA1044](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1044) | Properties should not be write only | Design |
| [CA1050](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1050) | Declare types in namespaces | Design |
| [CA1058](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1058) | Types should not extend certain base types | Design |
| [CA1060](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1060) | Move pinvokes to native methods class | Design |
| [CA1061](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1061) | Do not hide base class methods | Design |
| [CA1063](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1063) | Implement IDisposable Correctly | Design |
| [CA1200](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1200) | Avoid using cref tags with a prefix | Documentation |
| [CA1304](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1304) | Specify CultureInfo | Globalization |
| [CA1305](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1305) | Specify IFormatProvider | Globalization |
| [CA1307](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1307) | Specify StringComparison for clarity | Globalization |
| [CA1308](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1308) | Normalize strings to uppercase | Globalization |
| [CA1710](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1710) | Identifiers should have correct suffix | Naming |
| [CA1711](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1711) | Identifiers should not have incorrect suffix | Naming |
| [CA1715](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1715) | Identifiers should have correct prefix | Naming |
| [CA1716](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1716) | Identifiers should not match keywords | Naming |
| [CA1721](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1721) | Property names should not match get methods | Naming |
| [CA1724](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1724) | Type names should not match namespaces | Naming |
| [CA1812](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812) | Avoid uninstantiated internal classes | Performance |
| [CA1814](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1814) | Prefer jagged arrays over multidimensional | Performance |
| [CA1816](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) | Dispose methods should call SuppressFinalize | Usage |
| [CA2002](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2002) | Do not lock on objects with weak identity | Reliability |
| [CA2008](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2008) | Do not create tasks without passing a TaskScheduler | Reliability |
| [CA2207](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2207) | Initialize value type static fields inline | Usage |
| [CA2211](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2211) | Non-constant fields should not be visible | Usage |
| [CA2215](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2215) | Dispose methods should call base class dispose | Usage |
| [CA2216](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2216) | Disposable types should declare finalizer | Usage |

## Rules whose analyzer is also unimplemented (11)

These are stubs end to end. The analyzer's `SupportedDiagnostics` is empty, so the rule does
not ship, has no release-tracking row, and never reports. A fixer is moot until the analyzer
itself is written.

| Rule | Title | `RuleLevel` |
|------|-------|-------------|
| [CA1301](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1301) | Avoid duplicate accelerators | `Disabled` |
| [CA1306](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1306) | Set locale for data types | `Disabled` |
| [CA1414](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1414) | Mark boolean PInvoke arguments with MarshalAs | `Disabled` |
| [CA1500](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1500) | Variable names should not match field names | `Disabled` |
| [CA1601](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1601) | Do not use timers that prevent power state changes | `Disabled` |
| [CA1726](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1726) | Use preferred terms | `Disabled` |
| [CA2001](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2001) | Avoid calling problematic methods | `Disabled` |
| [CA2205](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2205) | Use managed equivalents of win32 api | `CandidateForRemoval` |
| [CA2212](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2212) | Do not mark serviced components with WebMethod | `Disabled` |
| [CA2236](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2236) | Call base class methods on ISerializable types | `Disabled` |
| [CA2239](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2239) | Provide deserialization methods for optional fields | `Disabled` |
13 changes: 13 additions & 0 deletions src/Microsoft.CodeAnalysis.NetAnalyzers/src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[*.{cs,vb}]

# Microsoft.CodeAnalysis.Analyzers (referenced in Directory.Build.props) ships six rule
# categories. Every one of them is clean across this tree, so all six are enforced to keep
# it that way. RS1024, RS1036 and RS1038 are the exceptions and stay suppressed through
# NoWarn in Directory.Build.props, each against a tracking issue.
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisCompatibility.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisCorrectness.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisDesign.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisDocumentation.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisLocalization.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisPerformance.severity = warning
dotnet_analyzer_diagnostic.category-MicrosoftCodeAnalysisReleaseTracking.severity = warning
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@
<NetAnalyzersRootDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)..'))</NetAnalyzersRootDir>
</PropertyGroup>

<ItemGroup>
<!--
Dogfoods Microsoft.CodeAnalysis.Analyzers' own RS-series meta-analyzers against this repo's
analyzers and fixers, most notably RS2000/RS2001 which validate the AnalyzerReleases.*.md
release-tracking files consumed as AdditionalFiles (see Directory.Build.targets). Only the
MicrosoftCodeAnalysisReleaseTracking category is enabled by default; see the repo's
.editorconfig for the rest of the package's categories.
-->
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<!-- When building in source build mode, treat this set of warnings not as errors.-->
<!-- Some crefs reference internal APIs not present in the reference package. -->
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading