Add MA0211 to enforce multi-line XML documentation comments#1218
Merged
Conversation
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add analyser rule for enforcing multi-line XML summaries
Add MA0211 to enforce multi-line XML documentation comments
Jul 7, 2026
meziantou
reviewed
Jul 8, 2026
| { | ||
| await CreateProjectBuilder() | ||
| .WithSourceCode(""" | ||
| /// <summary>This has <c>code</c> inside</summary> |
Owner
There was a problem hiding this comment.
@copilot This should be reported. Skip the logic to find nested elements. Report all non-empty summary element that are single line.
Also, do not report other elements, only summary. Make sure to also update the rule title, description and documentation page
Contributor
Author
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
This was referenced Jul 8, 2026
Merged
Merged
This was referenced Jul 14, 2026
Open
Open
Open
Bump Meziantou.Analyzer from 3.0.103 to 3.0.123
Analogy-LogViewer/Analogy.LogViewer.OpenTelemetry#66
Open
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.
This adds a complementary rule to MA0177 for teams that want XML documentation comments to always use multi-line formatting, even when the content fits on a single line. The new rule is disabled by default so it can be enabled selectively.
New analyzer rule
MA0211to report single-line XML documentation elements such as<summary>and<param>when they can be rewritten in multi-line formCode fix
///formTests
<summary>and<param>elementsRule metadata and docs
docs/Rules/MA0211.mdMA0211appears alongside the existing analyzer setExample: