You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ If you are already using other analyzers, you can check [which rules are duplica
229
229
|[MA0208](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0208.md)|Usage|\[FixedAddressValueType\] fields must be value types|⚠️|✔️|❌|
230
230
|[MA0209](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0209.md)|Performance|Use in keyword for in parameter|ℹ️|❌|✔️|
231
231
|[MA0210](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0210.md)|Performance|Use in keyword to call the in overload|ℹ️|❌|✔️|
232
-
|[MA0211](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0211.md)|Style|Use multi-line XML comment syntax|ℹ️|❌|✔️|
232
+
|[MA0211](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0211.md)|Style|Use multi-line syntax for XML summary comments|ℹ️|❌|✔️|
Copy file name to clipboardExpand all lines: docs/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@
209
209
|[MA0208](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0208.md)|Usage|\[FixedAddressValueType\] fields must be value types|<spantitle='Warning'>⚠️</span>|✔️|❌|
210
210
|[MA0209](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0209.md)|Performance|Use in keyword for in parameter|<spantitle='Info'>ℹ️</span>|❌|✔️|
211
211
|[MA0210](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0210.md)|Performance|Use in keyword to call the in overload|<spantitle='Info'>ℹ️</span>|❌|✔️|
212
-
|[MA0211](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0211.md)|Style|Use multi-line XML comment syntax|<spantitle='Info'>ℹ️</span>|❌|✔️|
212
+
|[MA0211](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0211.md)|Style|Use multi-line syntax for XML summary comments|<spantitle='Info'>ℹ️</span>|❌|✔️|
This rule reports XML documentation comments written on a single line when they can be expanded to the standard multi-line XML comment form.
6
+
This rule reports single-line `<summary>`XML documentation comments when they contain non-empty content and can be expanded to the standard multi-line XML comment form.
7
7
8
8
````csharp
9
9
/// <summary>Description</summary>
@@ -18,16 +18,15 @@ public class Sample { }
18
18
19
19
## When to use multi-line format
20
20
21
-
Use this rule when you want XML documentation comments to consistently use the multi-line form, even when the content fits on a single line.
21
+
Use this rule when you want `<summary>`XML documentation comments to consistently use the multi-line form, even when the content fits on a single line.
22
22
23
23
## When NOT to use multi-line format
24
24
25
25
The analyzer will NOT suggest converting when:
26
26
27
-
- The XML element already spans multiple lines
28
-
- The element contains multiple lines of source content
29
-
- The element contains CDATA sections
30
-
- The element contains nested XML elements (like `<c>`, `<see>`, etc.)
27
+
- The `<summary>` element already spans multiple lines
28
+
- The `<summary>` element is empty or contains only whitespace
29
+
- The XML documentation element is not a `<summary>` element
31
30
32
31
## Examples
33
32
@@ -42,10 +41,11 @@ public int Add(int a, int b) => a + b;
42
41
/// </summary>
43
42
publicintAdd(inta, intb) =>a+b;
44
43
45
-
// Compliant: Multiple lines of source content
46
-
/// <summary>
47
-
/// Returns the sum of two numbers.
48
-
/// This method handles integer overflow.
49
-
/// </summary>
44
+
// Compliant: Empty summary
45
+
/// <summary></summary>
50
46
publicintAdd(inta, intb) =>a+b;
47
+
48
+
// Compliant: Other XML documentation elements are ignored
0 commit comments