Skip to content

Commit b52402d

Browse files
committed
Rename ASP005ParameterSyntax
1 parent 636db09 commit b52402d

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

AspNetCoreAnalyzers.Tests/ASP004ParameterSyntaxTests/CodeFix.cs renamed to AspNetCoreAnalyzers.Tests/ASP005ParameterSyntaxTests/CodeFix.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AspNetCoreAnalyzers.Tests.ASP004ParameterSyntaxTests
1+
namespace AspNetCoreAnalyzers.Tests.ASP005ParameterSyntaxTests
22
{
33
using Gu.Roslyn.Asserts;
44
using Microsoft.CodeAnalysis.CodeFixes;
@@ -8,7 +8,7 @@ namespace AspNetCoreAnalyzers.Tests.ASP004ParameterSyntaxTests
88
public class CodeFix
99
{
1010
private static readonly DiagnosticAnalyzer Analyzer = new AttributeAnalyzer();
11-
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create(ASP004ParameterSyntax.Descriptor);
11+
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create(ASP005ParameterSyntax.Descriptor);
1212
private static readonly CodeFixProvider Fix = new TemplateTextFix();
1313

1414
[TestCase("api/orders/↓id:long}", "api/orders/{id:long}")]

AspNetCoreAnalyzers.Tests/ASP004ParameterSyntaxTests/Diagnostics.cs renamed to AspNetCoreAnalyzers.Tests/ASP005ParameterSyntaxTests/Diagnostics.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AspNetCoreAnalyzers.Tests.ASP004ParameterSyntaxTests
1+
namespace AspNetCoreAnalyzers.Tests.ASP005ParameterSyntaxTests
22
{
33
using System.Globalization;
44
using Gu.Roslyn.Asserts;
@@ -10,7 +10,7 @@ namespace AspNetCoreAnalyzers.Tests.ASP004ParameterSyntaxTests
1010
public class Diagnostics
1111
{
1212
private static readonly DiagnosticAnalyzer Analyzer = new AttributeAnalyzer();
13-
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create(ASP004ParameterSyntax.Descriptor);
13+
private static readonly ExpectedDiagnostic ExpectedDiagnostic = ExpectedDiagnostic.Create(ASP005ParameterSyntax.Descriptor);
1414

1515
[TestCase("\"api/orders/{id:↓wrong}\"")]
1616
[TestCase("@\"api/orders/{id:↓wrong}\"")]
@@ -90,8 +90,8 @@ public IActionResult GetId(string id)
9090
}".AssertReplace("\"api/orders/{id:wrong}\"", before);
9191

9292
var expectedDiagnostic = new ExpectedDiagnostic(
93-
ASP004ParameterSyntax.DiagnosticId,
94-
ASP004ParameterSyntax.Descriptor.MessageFormat.ToString(CultureInfo.InvariantCulture),
93+
ASP005ParameterSyntax.DiagnosticId,
94+
ASP005ParameterSyntax.Descriptor.MessageFormat.ToString(CultureInfo.InvariantCulture),
9595
new FileLinePositionSpan("OrdersController.cs", new LinePosition(8, start), new LinePosition(8, end)));
9696
AnalyzerAssert.Diagnostics(Analyzer, expectedDiagnostic, code);
9797
}

AspNetCoreAnalyzers.Tests/ASP004ParameterSyntaxTests/ValidCode.cs renamed to AspNetCoreAnalyzers.Tests/ASP005ParameterSyntaxTests/ValidCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AspNetCoreAnalyzers.Tests.ASP004ParameterSyntaxTests
1+
namespace AspNetCoreAnalyzers.Tests.ASP005ParameterSyntaxTests
22
{
33
using Gu.Roslyn.Asserts;
44
using Microsoft.CodeAnalysis.Diagnostics;

AspNetCoreAnalyzers.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".docs", ".docs", "{1C271AF2
3232
documentation\ASP001.md = documentation\ASP001.md
3333
documentation\ASP002.md = documentation\ASP002.md
3434
documentation\ASP003.md = documentation\ASP003.md
35-
documentation\ASP004.md = documentation\ASP004.md
35+
documentation\ASP005.md = documentation\ASP005.md
3636
documentation\ASP006.md = documentation\ASP006.md
3737
README.md = README.md
3838
RELEASE_NOTES.md = RELEASE_NOTES.md

AspNetCoreAnalyzers/ASP004ParameterSyntax.cs renamed to AspNetCoreAnalyzers/ASP005ParameterSyntax.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ namespace AspNetCoreAnalyzers
22
{
33
using Microsoft.CodeAnalysis;
44

5-
internal static class ASP004ParameterSyntax
5+
internal static class ASP005ParameterSyntax
66
{
7-
public const string DiagnosticId = "ASP004";
7+
public const string DiagnosticId = "ASP005";
88

99
internal static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor(
1010
id: DiagnosticId,

AspNetCoreAnalyzers/Analyzers/AttributeAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class AttributeAnalyzer : DiagnosticAnalyzer
1818
ASP001ParameterName.Descriptor,
1919
ASP002MissingParameter.Descriptor,
2020
ASP003ParameterType.Descriptor,
21-
ASP004ParameterSyntax.Descriptor,
21+
ASP005ParameterSyntax.Descriptor,
2222
ASP006ParameterRegex.Descriptor);
2323

2424
public override void Initialize(AnalysisContext context)
@@ -96,7 +96,7 @@ context.ContainingSymbol is IMethodSymbol method &&
9696
{
9797
context.ReportDiagnostic(
9898
Diagnostic.Create(
99-
ASP004ParameterSyntax.Descriptor,
99+
ASP005ParameterSyntax.Descriptor,
100100
location,
101101
syntax == null
102102
? ImmutableDictionary<string, string>.Empty

AspNetCoreAnalyzers/CodeFixes/TemplateTextFix.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class TemplateTextFix : CodeFixProvider
1717
{
1818
public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(
1919
ASP002MissingParameter.DiagnosticId,
20-
ASP004ParameterSyntax.DiagnosticId,
20+
ASP005ParameterSyntax.DiagnosticId,
2121
ASP006ParameterRegex.DiagnosticId);
2222

2323
public override FixAllProvider GetFixAllProvider() => null;
@@ -55,7 +55,7 @@ private static string GetTitle(Diagnostic diagnostic)
5555
{
5656
case ASP002MissingParameter.DiagnosticId:
5757
return "Rename parameter";
58-
case ASP004ParameterSyntax.DiagnosticId:
58+
case ASP005ParameterSyntax.DiagnosticId:
5959
return "Fix syntax error.";
6060
case ASP006ParameterRegex.DiagnosticId:
6161
return "Escape regex.";

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Roslyn analyzers for ASP.NET.Core.
2323
<td>Parameter type does not match.</td>
2424
</tr>
2525
<tr>
26-
<td><a href="https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP004.md">ASP004</a></td>
26+
<td><a href="https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP005.md">ASP005</a></td>
2727
<td>Syntax error in parameter.</td>
2828
</tr>
2929
<tr>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# ASP004
1+
# ASP005
22
## Syntax error in parameter.
33

44
<!-- start generated table -->
55
<table>
66
<tr>
77
<td>CheckId</td>
8-
<td>ASP004</td>
8+
<td>ASP005</td>
99
</tr>
1010
<tr>
1111
<td>Severity</td>
@@ -64,21 +64,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
6464

6565
### Via #pragma directive.
6666
```C#
67-
#pragma warning disable ASP004 // Syntax error in parameter.
67+
#pragma warning disable ASP005 // Syntax error in parameter.
6868
Code violating the rule here
69-
#pragma warning restore ASP004 // Syntax error in parameter.
69+
#pragma warning restore ASP005 // Syntax error in parameter.
7070
```
7171

7272
Or put this at the top of the file to disable all instances.
7373
```C#
74-
#pragma warning disable ASP004 // Syntax error in parameter.
74+
#pragma warning disable ASP005 // Syntax error in parameter.
7575
```
7676

7777
### Via attribute `[SuppressMessage]`.
7878

7979
```C#
8080
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
81-
"ASP004:Syntax error in parameter.",
81+
"ASP005:Syntax error in parameter.",
8282
Justification = "Reason...")]
8383
```
8484
<!-- end generated config severity -->

0 commit comments

Comments
 (0)