Skip to content

Commit c916cb8

Browse files
committed
Inline doc stub template.
1 parent 74aed2d commit c916cb8

5 files changed

Lines changed: 68 additions & 314 deletions

File tree

AspNetCoreAnalyzers.Tests/AspNetCoreAnalyzers.Tests.csproj

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@
1616
<ItemGroup>
1717
<ProjectReference Include="..\AspNetCoreAnalyzers\AspNetCoreAnalyzers.csproj" />
1818
</ItemGroup>
19-
20-
<ItemGroup>
21-
<Compile Update="Properties\Resources.Designer.cs">
22-
<DesignTime>True</DesignTime>
23-
<AutoGen>True</AutoGen>
24-
<DependentUpon>Resources.resx</DependentUpon>
25-
</Compile>
26-
</ItemGroup>
27-
<ItemGroup>
28-
<EmbeddedResource Update="Properties\Resources.resx">
29-
<Generator>ResXFileCodeGenerator</Generator>
30-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
31-
</EmbeddedResource>
32-
</ItemGroup>
19+
3320
<Import Project="..\.paket\Paket.Restore.targets" />
3421
</Project>

AspNetCoreAnalyzers.Tests/Documentation/DiagnosticDocTemplate.txt

Lines changed: 0 additions & 67 deletions
This file was deleted.

AspNetCoreAnalyzers.Tests/Documentation/Tests.cs

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,73 @@ public void Index()
131131
private static string CreateStub(DescriptorInfo descriptorInfo)
132132
{
133133
var descriptor = descriptorInfo.Descriptor;
134-
var stub = Properties.Resources.DiagnosticDocTemplate
134+
var stub = @"# {ID}
135+
## ADD TITLE HERE
136+
137+
<!-- start generated table -->
138+
<table>
139+
<tr>
140+
<td>CheckId</td>
141+
<td>{ID}</td>
142+
</tr>
143+
<tr>
144+
<td>Severity</td>
145+
<td>{SEVERITY}</td>
146+
</tr>
147+
<tr>
148+
<td>Enabled</td>
149+
<td>{ENABLED}</td>
150+
</tr>
151+
<tr>
152+
<td>Category</td>
153+
<td>{CATEGORY}</td>
154+
</tr>
155+
<tr>
156+
<td>Code</td>
157+
<td><a href=""{URL}"">{TYPENAME}</a></td>
158+
</tr>
159+
</table>
160+
<!-- end generated table -->
161+
162+
## Description
163+
164+
ADD DESCRIPTION HERE
165+
166+
## Motivation
167+
168+
ADD MOTIVATION HERE
169+
170+
## How to fix violations
171+
172+
ADD HOW TO FIX VIOLATIONS HERE
173+
174+
<!-- start generated config severity -->
175+
## Configure severity
176+
177+
### Via ruleset file.
178+
179+
Configure the severity per project, for more info see [MSDN](https://msdn.microsoft.com/en-us/library/dd264949.aspx).
180+
181+
### Via #pragma directive.
182+
```C#
183+
#pragma warning disable {ID} // {TITLE}
184+
Code violating the rule here
185+
#pragma warning restore {ID} // {TITLE}
186+
```
187+
188+
Or put this at the top of the file to disable all instances.
189+
```C#
190+
#pragma warning disable {ID} // {TITLE}
191+
```
192+
193+
### Via attribute `[SuppressMessage]`.
194+
195+
```C#
196+
[System.Diagnostics.CodeAnalysis.SuppressMessage(""{CATEGORY}"",
197+
""{ID}:{TITLE}"",
198+
Justification = ""Reason..."")]
199+
```
200+
<!-- end generated config severity -->"
135201
.AssertReplace("{ID}", descriptor.Id)
136202
.AssertReplace("## ADD TITLE HERE", $"## {descriptor.Title.ToString(CultureInfo.InvariantCulture)}")
137203
.AssertReplace("{SEVERITY}", descriptor.DefaultSeverity.ToString())

AspNetCoreAnalyzers.Tests/Properties/Resources.Designer.cs

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)