Repository navigation
SA1653: Ignore summary tags in generated partial declarations - #4393
Conversation
WPF and similar generators emit placeholder summaries that falsely conflict with user docs.
There was a problem hiding this comment.
🟡 Changes recommended
Generated-code detection ignores configuration overrides and source-generated tree origin and mishandles markers, while Fix All can discard nested edits and leave conflicts unresolved.
5 open issues
What changed in this PR
This PR updates SA1653 to ignore summaries in generated partial declarations, preventing WPF-generated placeholders from conflicting with user-authored documentation.
Changes:
- Shares generated-document detection between the analyzer and code fix.
- Updates regression tests for generated partials and conflicts between user-authored summaries.
- Synchronizes the rule documentation across four languages.
| File | Description |
|---|---|
test/StyleCop.Analyzers.Test/DocumentationRules/SA1653UnitTests.cs |
Adds generated-part scenarios and updates code-fix expectations. |
src/StyleCop.Analyzers/Helpers/SyntaxTreeHelpers.cs |
Adds shared filename and header-based generated-document detection. |
src/StyleCop.Analyzers/DocumentationRules/SA1653OnlyOnePartialDeclarationShouldContainSummaryDocumentation.cs |
Excludes generated declarations when counting summaries. |
src/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1653CodeFixProvider.cs |
Filters generated declarations from summary edits and enables fixes for remaining conflicts. |
documentation/zh-cn/SA1653.md |
Updates Simplified Chinese documentation. |
documentation/SA1653.md |
Documents the revised generated-part behavior in English. |
documentation/ru-ru/SA1653.md |
Updates Russian documentation. |
documentation/cs-cz/SA1653.md |
Updates Czech documentation. |
Review effort: Balanced
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4393 +/- ##
==========================================
- Coverage 97.64% 97.63% -0.01%
==========================================
Files 1348 1349 +1
Lines 152728 152904 +176
Branches 5258 5267 +9
==========================================
+ Hits 149126 149295 +169
- Misses 2274 2280 +6
- Partials 1328 1329 +1 🚀 New features to boost your workflow:
|
Honor generated_code overrides, align markers with Roslyn heuristics, preserve nested Fix All edits, and cover detection paths independently.
There was a problem hiding this comment.
🟡 Changes recommended
The inherited tests fail on C# 9 and later due to an incompatible options provider, and end-to-end coverage is missing for editorconfig overrides in individual fixes and Fix All.
2 open issues
5 resolved since last review
Review effort: Balanced
The C# 8 AnalyzerConfigOptionsProvider stub lacks GlobalOptions, which breaks derived test hosts on Roslyn 3.8+.



Summary
Test plan