Skip to content

Commit 1a7e90a

Browse files
committed
Add documentation for DOC104-DOC107
1 parent bcf0238 commit 1a7e90a

File tree

5 files changed

+254
-0
lines changed

5 files changed

+254
-0
lines changed

docs/DOC104.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# DOC104
2+
3+
<table>
4+
<tr>
5+
<td>TypeName</td>
6+
<td>DOC104UseSeeLangword</td>
7+
</tr>
8+
<tr>
9+
<td>CheckId</td>
10+
<td>DOC104</td>
11+
</tr>
12+
<tr>
13+
<td>Category</td>
14+
<td>Style Rules</td>
15+
</tr>
16+
</table>
17+
18+
## Cause
19+
20+
The contains a language keyword reference using `<c>keyword</c>` that can be converted to the preferred form
21+
`<see langword="keyword"/>`.
22+
23+
## Rule description
24+
25+
A violation of this rule occurs when documentation a language keyword reference written in inline code that can be
26+
written in a preferred form using `see langword`.
27+
28+
```csharp
29+
/// <summary>
30+
/// This type is <c>sealed</c>.
31+
/// </summary>
32+
public sealed class SomeType
33+
{
34+
}
35+
```
36+
37+
## How to fix violations
38+
39+
To fix a violation of this rule, replace the inline code with the equivalent `see langword` syntax.
40+
41+
```csharp
42+
/// <summary>
43+
/// This type is <see langword="sealed"/>.
44+
/// </summary>
45+
public sealed class SomeType
46+
{
47+
}
48+
```
49+
50+
## How to suppress violations
51+
52+
```csharp
53+
#pragma warning disable DOC104 // Use 'see langword'
54+
/// <summary>
55+
/// This type is <c>sealed</c>.
56+
/// </summary>
57+
public sealed class SomeType
58+
#pragma warning restore DOC104 // Use 'see langword'
59+
{
60+
}
61+
```

docs/DOC105.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# DOC105
2+
3+
<table>
4+
<tr>
5+
<td>TypeName</td>
6+
<td>DOC105UseParamref</td>
7+
</tr>
8+
<tr>
9+
<td>CheckId</td>
10+
<td>DOC105</td>
11+
</tr>
12+
<tr>
13+
<td>Category</td>
14+
<td>Style Rules</td>
15+
</tr>
16+
</table>
17+
18+
## Cause
19+
20+
The contains a parameter reference using `<c>name</c>` that can be converted to the preferred form
21+
`<paramref name="name"/>`.
22+
23+
## Rule description
24+
25+
A violation of this rule occurs when documentation contains a parameter reference written in inline code that can be
26+
written in a preferred form using `paramref`.
27+
28+
```csharp
29+
/// <summary>
30+
/// Pass in a <c>value</c>.
31+
/// </summary>
32+
public void Method(int value)
33+
{
34+
}
35+
```
36+
37+
## How to fix violations
38+
39+
To fix a violation of this rule, replace the inline code with the equivalent `paramref` syntax.
40+
41+
```csharp
42+
/// <summary>
43+
/// Pass in a <paramref name="value"/>.
44+
/// </summary>
45+
public void Method(int value)
46+
{
47+
}
48+
```
49+
50+
## How to suppress violations
51+
52+
```csharp
53+
#pragma warning disable DOC105 // Use 'paramref'
54+
/// <summary>
55+
/// Pass in a <c>value</c>.
56+
/// </summary>
57+
public void Method(int value)
58+
#pragma warning restore DOC104 // Use 'paramref'
59+
{
60+
}
61+
```

docs/DOC106.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# DOC106
2+
3+
<table>
4+
<tr>
5+
<td>TypeName</td>
6+
<td>DOC106UseTypeparamref</td>
7+
</tr>
8+
<tr>
9+
<td>CheckId</td>
10+
<td>DOC106</td>
11+
</tr>
12+
<tr>
13+
<td>Category</td>
14+
<td>Style Rules</td>
15+
</tr>
16+
</table>
17+
18+
## Cause
19+
20+
The contains a type parameter reference using `<c>T</c>` that can be converted to the preferred form
21+
`<typeparamref name="T"/>`.
22+
23+
## Rule description
24+
25+
A violation of this rule occurs when documentation contains a type parameter reference written in inline code that can
26+
be written in a preferred form using `typeparamref`.
27+
28+
```csharp
29+
/// <summary>
30+
/// Pass in a <c>T</c>.
31+
/// </summary>
32+
public void Method<T>()
33+
{
34+
}
35+
```
36+
37+
## How to fix violations
38+
39+
To fix a violation of this rule, replace the inline code with the equivalent `typeparamref` syntax.
40+
41+
```csharp
42+
/// <summary>
43+
/// Pass in a <typeparamref name="T"/>.
44+
/// </summary>
45+
public void Method<T>()
46+
{
47+
}
48+
```
49+
50+
## How to suppress violations
51+
52+
```csharp
53+
#pragma warning disable DOC106 // Use 'typeparamref'
54+
/// <summary>
55+
/// Pass in a <c>T</c>.
56+
/// </summary>
57+
public void Method<T>()
58+
#pragma warning restore DOC106 // Use 'typeparamref'
59+
{
60+
}
61+
```

docs/DOC107.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# DOC107
2+
3+
<table>
4+
<tr>
5+
<td>TypeName</td>
6+
<td>DOC107UseSeeCref</td>
7+
</tr>
8+
<tr>
9+
<td>CheckId</td>
10+
<td>DOC107</td>
11+
</tr>
12+
<tr>
13+
<td>Category</td>
14+
<td>Style Rules</td>
15+
</tr>
16+
</table>
17+
18+
## Cause
19+
20+
The contains a code element reference using `<c>name</c>` that can be converted to the preferred form
21+
`<see cref="name"/>`.
22+
23+
## Rule description
24+
25+
A violation of this rule occurs when documentation contains a code element reference written in inline code that can
26+
be written in a preferred form using `see cref`.
27+
28+
```csharp
29+
int SomeValue { get; }
30+
31+
/// <summary>
32+
/// Depends on <c>SomeValue</c>.
33+
/// </summary>
34+
public void Method()
35+
{
36+
}
37+
```
38+
39+
## How to fix violations
40+
41+
To fix a violation of this rule, replace the inline code with the equivalent `see cref` syntax.
42+
43+
```csharp
44+
int SomeValue { get; }
45+
46+
/// <summary>
47+
/// Depends on <see cref="SomeValue"/>.
48+
/// </summary>
49+
public void Method()
50+
{
51+
}
52+
```
53+
54+
## How to suppress violations
55+
56+
```csharp
57+
int SomeValue { get; }
58+
59+
#pragma warning disable DOC107 // Use 'see cref'
60+
/// <summary>
61+
/// Depends on <c>SomeValue</c>.
62+
/// </summary>
63+
public void Method()
64+
#pragma warning restore DOC107 // Use 'see cref'
65+
{
66+
}
67+
```

docs/StyleRules.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ Identifier | Name | Description
88
[DOC101](DOC101.md) | UseChildBlocksConsistently | The documentation for the element contains some text which is wrapped in block-level elements, and other text which is written inline.
99
[DOC102](DOC102.md) | UseChildBlocksConsistentlyAcrossElementsOfTheSameKind | The documentation for the element contains inline text, but the documentation for a sibling element of the same kind uses block-level elements.
1010
[DOC103](DOC103.md) | UseUnicodeCharacters | The documentation contains an unnecessary or unrecognized HTML character entity.
11+
[DOC104](DOC104.md) | UseSeeLangword | The contains a language keyword reference using `<c>keyword</c>` that can be converted to the preferred form `<see langword="keyword"/>`.
12+
[DOC105](DOC105.md) | UseParamref | The contains a parameter reference using `<c>name</c>` that can be converted to the preferred form `<paramref name="name"/>`.
13+
[DOC106](DOC106.md) | UseTypeparamref | The contains a type parameter reference using `<c>T</c>` that can be converted to the preferred form `<typeparamref name="T"/>`.
14+
[DOC107](DOC107.md) | UseSeeCref | The contains a code element reference using `<c>name</c>` that can be converted to the preferred form `<see cref="name"/>`.
1115
[DOC108](DOC108.md) | AvoidEmptyParagraphs | The documentation contains an empty paragraph element (`<para/>` or `<p/>`) used as a paragraph separator.

0 commit comments

Comments
 (0)