Repository navigation
Document CA1878: Prefer ReadOnlySpan properties over readonly array fields - #55637
Merged
gewarren merged 2 commits intoAug 26, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation for the new code analysis rule CA1878 and wires it into the diagnostics navigation and rule indexes so it shows up in the right tables of contents and lists.
Changes:
- Adds a new reference article for CA1878, including guidance, supported types, framework requirements, and suppression info.
- Adds a C# snippet file demonstrating a violation and a fix.
- Updates the diagnostics TOC and Performance/quality-rule indexes to include CA1878.
Show a summary per file
| File | Description |
|---|---|
| docs/navigate/tools-diagnostics/toc.yml | Adds CA1878 to the diagnostics TOC. |
| docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/CA1878.cs | Adds C# examples for the CA1878 article. |
| docs/fundamentals/code-analysis/quality-rules/performance-warnings.md | Adds CA1878 to the Performance warnings list. |
| docs/fundamentals/code-analysis/quality-rules/index.md | Adds CA1878 to the quality rule index table. |
| docs/fundamentals/code-analysis/quality-rules/ca1878.md | New CA1878 documentation page with examples and guidance. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
gewarren
approved these changes
Aug 24, 2026
gewarren
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for adding this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents CA1878, including supported element types, target-framework requirements, conservative fixer behavior, suppression guidance, and C# examples.
Adds CA1878 to the quality-rule index, Performance rule list, and diagnostics TOC.
Source: Analyzer behavior and constraints are adapted from dotnet/sdk#55901. The explanatory text and examples are newly authored and should receive analyzer-owner review.
Note
This pull request description was drafted with GitHub Copilot.
Internal previews