Skip to content

Commit 6544bd3

Browse files
committed
´Fix warnings
1 parent 6d6ba80 commit 6544bd3

16 files changed

Lines changed: 105 additions & 105 deletions

File tree

AspNetCoreAnalyzers.Tests/ASP007MissingParameterTests/Diagnostics.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class OrdersController : Controller
2424
public IActionResult Get() => this.Ok();
2525
}
2626
}";
27-
var message = "The route template has parameter 'id' that does not have a corresponding method parameter.";
27+
var message = "The route template has parameter 'id' that does not have a corresponding method parameter";
2828
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), code);
2929
}
3030

@@ -80,7 +80,7 @@ public async Task<IActionResult> Get(int orderId)
8080
}
8181
}
8282
}";
83-
var message = "The route template has parameter 'itemId' that does not have a corresponding method parameter.";
83+
var message = "The route template has parameter 'itemId' that does not have a corresponding method parameter";
8484
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), order, db, code);
8585
}
8686

@@ -204,7 +204,7 @@ public IActionResult Get()
204204
}
205205
}
206206
}";
207-
var message = "The route template has parameter 'id' that does not have a corresponding method parameter.";
207+
var message = "The route template has parameter 'id' that does not have a corresponding method parameter";
208208
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), code);
209209
}
210210

AspNetCoreAnalyzers/Descriptors.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,44 @@ internal static class Descriptors
66
{
77
internal static readonly DiagnosticDescriptor ASP001ParameterSymbolName = Create(
88
id: "ASP001",
9-
title: "Parameter name does not match the name specified by the route parameter.",
10-
messageFormat: "Parameter name does not match the name specified by the route parameter.",
9+
title: "Parameter name does not match the name specified by the route parameter",
10+
messageFormat: "Parameter name does not match the name specified by the route parameter",
1111
category: AnalyzerCategory.Routing,
1212
defaultSeverity: DiagnosticSeverity.Warning,
1313
isEnabledByDefault: true,
1414
description: "Parameter name does not match the name specified by the route parameter.");
1515

1616
internal static readonly DiagnosticDescriptor ASP002RouteParameterName = Descriptors.Create(
1717
id: "ASP002",
18-
title: "Route parameter name does not match the method parameter name.",
19-
messageFormat: "Route parameter name does not match the method parameter name.",
18+
title: "Route parameter name does not match the method parameter name",
19+
messageFormat: "Route parameter name does not match the method parameter name",
2020
category: AnalyzerCategory.Routing,
2121
defaultSeverity: DiagnosticSeverity.Warning,
2222
isEnabledByDefault: true,
2323
description: "Route parameter name does not match the method parameter name.");
2424

2525
internal static readonly DiagnosticDescriptor ASP003ParameterSymbolType = Descriptors.Create(
2626
id: "ASP003",
27-
title: "Parameter type does not match the type specified by the name specified by the route parameter.",
28-
messageFormat: "Parameter type does not match the type specified by the name specified by the route parameter.",
27+
title: "Parameter type does not match the type specified by the name specified by the route parameter",
28+
messageFormat: "Parameter type does not match the type specified by the name specified by the route parameter",
2929
category: AnalyzerCategory.Routing,
3030
defaultSeverity: DiagnosticSeverity.Warning,
3131
isEnabledByDefault: true,
3232
description: "Parameter type does not match the type specified by the name specified by the route parameter.");
3333

3434
internal static readonly DiagnosticDescriptor ASP004RouteParameterType = Descriptors.Create(
3535
id: "ASP004",
36-
title: "Route parameter type does not match the method parameter type.",
37-
messageFormat: "Route parameter type does not match the method parameter type.",
36+
title: "Route parameter type does not match the method parameter type",
37+
messageFormat: "Route parameter type does not match the method parameter type",
3838
category: AnalyzerCategory.Routing,
3939
defaultSeverity: DiagnosticSeverity.Warning,
4040
isEnabledByDefault: true,
4141
description: "Route parameter type does not match the method parameter type.");
4242

4343
internal static readonly DiagnosticDescriptor ASP005ParameterSyntax = Descriptors.Create(
4444
id: "ASP005",
45-
title: "Syntax error in parameter.",
46-
messageFormat: "Syntax error in parameter.",
45+
title: "Syntax error in parameter",
46+
messageFormat: "Syntax error in parameter",
4747
category: AnalyzerCategory.Routing,
4848
defaultSeverity: DiagnosticSeverity.Warning,
4949
isEnabledByDefault: true,
@@ -54,43 +54,43 @@ internal static class Descriptors
5454
/// </summary>
5555
internal static readonly DiagnosticDescriptor ASP006ParameterRegex = Descriptors.Create(
5656
id: "ASP006",
57-
title: "Escape constraint regex.",
58-
messageFormat: "Escape constraint regex.",
57+
title: "Escape constraint regex",
58+
messageFormat: "Escape constraint regex",
5959
category: AnalyzerCategory.Routing,
6060
defaultSeverity: DiagnosticSeverity.Warning,
6161
isEnabledByDefault: true,
6262
description: "Escape constraint regex.");
6363

6464
internal static readonly DiagnosticDescriptor ASP007MissingParameter = Descriptors.Create(
6565
id: "ASP007",
66-
title: "The method has no corresponding parameter.",
67-
messageFormat: "The route template has parameter '{0}' that does not have a corresponding method parameter.",
66+
title: "The method has no corresponding parameter",
67+
messageFormat: "The route template has parameter '{0}' that does not have a corresponding method parameter",
6868
category: AnalyzerCategory.Routing,
6969
defaultSeverity: DiagnosticSeverity.Warning,
7070
isEnabledByDefault: true,
7171
description: "The method has no corresponding parameter.");
7272

7373
internal static readonly DiagnosticDescriptor ASP008ValidRouteParameterName = Descriptors.Create(
7474
id: "ASP008",
75-
title: "Invalid route parameter name.",
76-
messageFormat: "Invalid route parameter name.",
75+
title: "Invalid route parameter name",
76+
messageFormat: "Invalid route parameter name",
7777
category: AnalyzerCategory.Routing,
7878
defaultSeverity: DiagnosticSeverity.Warning,
7979
isEnabledByDefault: true,
8080
description: "Invalid route parameter name.");
8181

8282
internal static readonly DiagnosticDescriptor ASP009KebabCaseUrl = Descriptors.Create(
8383
id: "ASP009",
84-
title: "Use kebab-cased urls.",
85-
messageFormat: "Use kebab-cased urls.",
84+
title: "Use kebab-cased urls",
85+
messageFormat: "Use kebab-cased urls",
8686
category: AnalyzerCategory.Routing,
8787
defaultSeverity: DiagnosticSeverity.Warning,
8888
isEnabledByDefault: true,
8989
description: "Use kebab-cased urls.");
9090

9191
internal static readonly DiagnosticDescriptor ASP010UrlSyntax = Descriptors.Create(
9292
id: "ASP010",
93-
title: "Unexpected character in url.",
93+
title: "Unexpected character in url",
9494
messageFormat: "Literal sections cannot contain the '{0}' character",
9595
category: AnalyzerCategory.Routing,
9696
defaultSeverity: DiagnosticSeverity.Warning,
@@ -99,25 +99,25 @@ internal static class Descriptors
9999

100100
internal static readonly DiagnosticDescriptor ASP011RouteParameterNameMustBeUnique = Descriptors.Create(
101101
id: "ASP011",
102-
title: "Route parameter appears more than once.",
103-
messageFormat: "Route parameter appears more than once.",
102+
title: "Route parameter appears more than once",
103+
messageFormat: "Route parameter appears more than once",
104104
category: AnalyzerCategory.Routing,
105105
defaultSeverity: DiagnosticSeverity.Warning,
106106
isEnabledByDefault: true,
107107
description: "Route parameter appears more than once.");
108108

109109
internal static readonly DiagnosticDescriptor ASP012UseExplicitRoute = Descriptors.Create(
110110
id: "ASP012",
111-
title: "Don't use [controller].",
112-
messageFormat: "Don't use [controller].",
111+
title: "Don't use [controller]",
112+
messageFormat: "Don't use [controller]",
113113
category: AnalyzerCategory.Routing,
114114
defaultSeverity: DiagnosticSeverity.Warning,
115115
isEnabledByDefault: true,
116116
description: "Don't use [controller]. Prefer explicit string so that renaming the class is not a breaking change.");
117117

118118
internal static readonly DiagnosticDescriptor ASP013ControllerNameShouldMatchRoute = Descriptors.Create(
119119
id: "ASP013",
120-
title: "Name the controller to match the route.",
120+
title: "Name the controller to match the route",
121121
messageFormat: "Name the controller to match the route. Expected: '{0}'.",
122122
category: AnalyzerCategory.Routing,
123123
defaultSeverity: DiagnosticSeverity.Warning,

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ Roslyn analyzers for ASP.NET.Core.
1313

1414
| Id | Title
1515
| :-- | :--
16-
| [ASP001](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP001.md)| Parameter name does not match the name specified by the route parameter.
17-
| [ASP002](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP002.md)| Route parameter name does not match the method parameter name.
18-
| [ASP003](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP003.md)| Parameter type does not match the type specified by the name specified by the route parameter.
19-
| [ASP004](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP004.md)| Route parameter type does not match the method parameter type.
20-
| [ASP005](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP005.md)| Syntax error in parameter.
21-
| [ASP006](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP006.md)| Escape constraint regex.
22-
| [ASP007](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP007.md)| The method has no corresponding parameter.
23-
| [ASP008](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP008.md)| Invalid route parameter name.
24-
| [ASP009](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP009.md)| Use kebab-cased urls.
25-
| [ASP010](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP010.md)| Unexpected character in url.
26-
| [ASP011](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP011.md)| Route parameter appears more than once.
27-
| [ASP012](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP012.md)| Don't use [controller].
28-
| [ASP013](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP013.md)| Name the controller to match the route.
16+
| [ASP001](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP001.md)| Parameter name does not match the name specified by the route parameter
17+
| [ASP002](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP002.md)| Route parameter name does not match the method parameter name
18+
| [ASP003](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP003.md)| Parameter type does not match the type specified by the name specified by the route parameter
19+
| [ASP004](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP004.md)| Route parameter type does not match the method parameter type
20+
| [ASP005](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP005.md)| Syntax error in parameter
21+
| [ASP006](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP006.md)| Escape constraint regex
22+
| [ASP007](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP007.md)| The method has no corresponding parameter
23+
| [ASP008](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP008.md)| Invalid route parameter name
24+
| [ASP009](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP009.md)| Use kebab-cased urls
25+
| [ASP010](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP010.md)| Unexpected character in url
26+
| [ASP011](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP011.md)| Route parameter appears more than once
27+
| [ASP012](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP012.md)| Don't use [controller]
28+
| [ASP013](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP013.md)| Name the controller to match the route
2929

3030

3131
## Using AspNetCoreAnalyzers

documentation/ASP001.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ASP001
2-
## Parameter name does not match the name specified by the route parameter.
2+
## Parameter name does not match the name specified by the route parameter
33

44
| Topic | Value
55
| :-- | :--
@@ -58,21 +58,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
5858

5959
### Via #pragma directive.
6060
```C#
61-
#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter.
61+
#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter
6262
Code violating the rule here
63-
#pragma warning restore ASP001 // Parameter name does not match the name specified by the route parameter.
63+
#pragma warning restore ASP001 // Parameter name does not match the name specified by the route parameter
6464
```
6565

6666
Or put this at the top of the file to disable all instances.
6767
```C#
68-
#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter.
68+
#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter
6969
```
7070

7171
### Via attribute `[SuppressMessage]`.
7272

7373
```C#
7474
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
75-
"ASP001:Parameter name does not match the name specified by the route parameter.",
75+
"ASP001:Parameter name does not match the name specified by the route parameter",
7676
Justification = "Reason...")]
7777
```
7878
<!-- end generated config severity -->

documentation/ASP002.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ASP002
2-
## Route parameter name does not match the method parameter name.
2+
## Route parameter name does not match the method parameter name
33

44
| Topic | Value
55
| :-- | :--
@@ -58,21 +58,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
5858

5959
### Via #pragma directive.
6060
```C#
61-
#pragma warning disable ASP002 // Route parameter name does not match the method parameter name.
61+
#pragma warning disable ASP002 // Route parameter name does not match the method parameter name
6262
Code violating the rule here
63-
#pragma warning restore ASP002 // Route parameter name does not match the method parameter name.
63+
#pragma warning restore ASP002 // Route parameter name does not match the method parameter name
6464
```
6565

6666
Or put this at the top of the file to disable all instances.
6767
```C#
68-
#pragma warning disable ASP002 // Route parameter name does not match the method parameter name.
68+
#pragma warning disable ASP002 // Route parameter name does not match the method parameter name
6969
```
7070

7171
### Via attribute `[SuppressMessage]`.
7272

7373
```C#
7474
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
75-
"ASP002:Route parameter name does not match the method parameter name.",
75+
"ASP002:Route parameter name does not match the method parameter name",
7676
Justification = "Reason...")]
7777
```
7878
<!-- end generated config severity -->

documentation/ASP003.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ASP003
2-
## Parameter type does not match the type specified by the name specified by the route parameter.
2+
## Parameter type does not match the type specified by the name specified by the route parameter
33

44
| Topic | Value
55
| :-- | :--
@@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
3030

3131
### Via #pragma directive.
3232
```C#
33-
#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter.
33+
#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter
3434
Code violating the rule here
35-
#pragma warning restore ASP003 // Parameter type does not match the type specified by the name specified by the route parameter.
35+
#pragma warning restore ASP003 // Parameter type does not match the type specified by the name specified by the route parameter
3636
```
3737

3838
Or put this at the top of the file to disable all instances.
3939
```C#
40-
#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter.
40+
#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter
4141
```
4242

4343
### Via attribute `[SuppressMessage]`.
4444

4545
```C#
4646
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
47-
"ASP003:Parameter type does not match the type specified by the name specified by the route parameter.",
47+
"ASP003:Parameter type does not match the type specified by the name specified by the route parameter",
4848
Justification = "Reason...")]
4949
```
5050
<!-- end generated config severity -->

documentation/ASP004.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ASP004
2-
## Route parameter type does not match the method parameter type.
2+
## Route parameter type does not match the method parameter type
33

44
| Topic | Value
55
| :-- | :--
@@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
3030

3131
### Via #pragma directive.
3232
```C#
33-
#pragma warning disable ASP004 // Route parameter type does not match the method parameter type.
33+
#pragma warning disable ASP004 // Route parameter type does not match the method parameter type
3434
Code violating the rule here
35-
#pragma warning restore ASP004 // Route parameter type does not match the method parameter type.
35+
#pragma warning restore ASP004 // Route parameter type does not match the method parameter type
3636
```
3737

3838
Or put this at the top of the file to disable all instances.
3939
```C#
40-
#pragma warning disable ASP004 // Route parameter type does not match the method parameter type.
40+
#pragma warning disable ASP004 // Route parameter type does not match the method parameter type
4141
```
4242

4343
### Via attribute `[SuppressMessage]`.
4444

4545
```C#
4646
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
47-
"ASP004:Route parameter type does not match the method parameter type.",
47+
"ASP004:Route parameter type does not match the method parameter type",
4848
Justification = "Reason...")]
4949
```
5050
<!-- end generated config severity -->

0 commit comments

Comments
 (0)