diff --git a/AspNetCoreAnalyzers.Tests/ASP007MissingParameterTests/Diagnostics.cs b/AspNetCoreAnalyzers.Tests/ASP007MissingParameterTests/Diagnostics.cs index 3243e62..a998de1 100644 --- a/AspNetCoreAnalyzers.Tests/ASP007MissingParameterTests/Diagnostics.cs +++ b/AspNetCoreAnalyzers.Tests/ASP007MissingParameterTests/Diagnostics.cs @@ -24,7 +24,7 @@ public class OrdersController : Controller public IActionResult Get() => this.Ok(); } }"; - var message = "The route template has parameter 'id' that does not have a corresponding method parameter."; + var message = "The route template has parameter 'id' that does not have a corresponding method parameter"; RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), code); } @@ -80,7 +80,7 @@ public async Task Get(int orderId) } } }"; - var message = "The route template has parameter 'itemId' that does not have a corresponding method parameter."; + var message = "The route template has parameter 'itemId' that does not have a corresponding method parameter"; RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), order, db, code); } @@ -204,7 +204,7 @@ public IActionResult Get() } } }"; - var message = "The route template has parameter 'id' that does not have a corresponding method parameter."; + var message = "The route template has parameter 'id' that does not have a corresponding method parameter"; RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage(message), code); } diff --git a/AspNetCoreAnalyzers/Descriptors.cs b/AspNetCoreAnalyzers/Descriptors.cs index 41dc601..a016c61 100644 --- a/AspNetCoreAnalyzers/Descriptors.cs +++ b/AspNetCoreAnalyzers/Descriptors.cs @@ -6,8 +6,8 @@ internal static class Descriptors { internal static readonly DiagnosticDescriptor ASP001ParameterSymbolName = Create( id: "ASP001", - title: "Parameter name does not match the name specified by the route parameter.", - messageFormat: "Parameter name does not match the name specified by the route parameter.", + title: "Parameter name does not match the name specified by the route parameter", + messageFormat: "Parameter name does not match the name specified by the route parameter", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -15,8 +15,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP002RouteParameterName = Descriptors.Create( id: "ASP002", - title: "Route parameter name does not match the method parameter name.", - messageFormat: "Route parameter name does not match the method parameter name.", + title: "Route parameter name does not match the method parameter name", + messageFormat: "Route parameter name does not match the method parameter name", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -24,8 +24,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP003ParameterSymbolType = Descriptors.Create( id: "ASP003", - title: "Parameter type does not match the type specified by the name specified by the route parameter.", - messageFormat: "Parameter type does not match the type specified by the name specified by the route parameter.", + title: "Parameter type does not match the type specified by the name specified by the route parameter", + messageFormat: "Parameter type does not match the type specified by the name specified by the route parameter", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -33,8 +33,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP004RouteParameterType = Descriptors.Create( id: "ASP004", - title: "Route parameter type does not match the method parameter type.", - messageFormat: "Route parameter type does not match the method parameter type.", + title: "Route parameter type does not match the method parameter type", + messageFormat: "Route parameter type does not match the method parameter type", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -42,8 +42,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP005ParameterSyntax = Descriptors.Create( id: "ASP005", - title: "Syntax error in parameter.", - messageFormat: "Syntax error in parameter.", + title: "Syntax error in parameter", + messageFormat: "Syntax error in parameter", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -54,8 +54,8 @@ internal static class Descriptors /// internal static readonly DiagnosticDescriptor ASP006ParameterRegex = Descriptors.Create( id: "ASP006", - title: "Escape constraint regex.", - messageFormat: "Escape constraint regex.", + title: "Escape constraint regex", + messageFormat: "Escape constraint regex", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -63,8 +63,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP007MissingParameter = Descriptors.Create( id: "ASP007", - title: "The method has no corresponding parameter.", - messageFormat: "The route template has parameter '{0}' that does not have a corresponding method parameter.", + title: "The method has no corresponding parameter", + messageFormat: "The route template has parameter '{0}' that does not have a corresponding method parameter", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -72,8 +72,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP008ValidRouteParameterName = Descriptors.Create( id: "ASP008", - title: "Invalid route parameter name.", - messageFormat: "Invalid route parameter name.", + title: "Invalid route parameter name", + messageFormat: "Invalid route parameter name", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -81,8 +81,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP009KebabCaseUrl = Descriptors.Create( id: "ASP009", - title: "Use kebab-cased urls.", - messageFormat: "Use kebab-cased urls.", + title: "Use kebab-cased urls", + messageFormat: "Use kebab-cased urls", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -90,7 +90,7 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP010UrlSyntax = Descriptors.Create( id: "ASP010", - title: "Unexpected character in url.", + title: "Unexpected character in url", messageFormat: "Literal sections cannot contain the '{0}' character", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, @@ -99,8 +99,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP011RouteParameterNameMustBeUnique = Descriptors.Create( id: "ASP011", - title: "Route parameter appears more than once.", - messageFormat: "Route parameter appears more than once.", + title: "Route parameter appears more than once", + messageFormat: "Route parameter appears more than once", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -108,8 +108,8 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP012UseExplicitRoute = Descriptors.Create( id: "ASP012", - title: "Don't use [controller].", - messageFormat: "Don't use [controller].", + title: "Don't use [controller]", + messageFormat: "Don't use [controller]", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -117,7 +117,7 @@ internal static class Descriptors internal static readonly DiagnosticDescriptor ASP013ControllerNameShouldMatchRoute = Descriptors.Create( id: "ASP013", - title: "Name the controller to match the route.", + title: "Name the controller to match the route", messageFormat: "Name the controller to match the route. Expected: '{0}'.", category: AnalyzerCategory.Routing, defaultSeverity: DiagnosticSeverity.Warning, diff --git a/README.md b/README.md index 72aeb03..ddda221 100644 --- a/README.md +++ b/README.md @@ -13,19 +13,19 @@ Roslyn analyzers for ASP.NET.Core. | Id | Title | :-- | :-- -| [ASP001](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP001.md)| Parameter name does not match the name specified by the route parameter. -| [ASP002](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP002.md)| Route parameter name does not match the method parameter name. -| [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. -| [ASP004](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP004.md)| Route parameter type does not match the method parameter type. -| [ASP005](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP005.md)| Syntax error in parameter. -| [ASP006](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP006.md)| Escape constraint regex. -| [ASP007](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP007.md)| The method has no corresponding parameter. -| [ASP008](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP008.md)| Invalid route parameter name. -| [ASP009](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP009.md)| Use kebab-cased urls. -| [ASP010](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP010.md)| Unexpected character in url. -| [ASP011](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP011.md)| Route parameter appears more than once. -| [ASP012](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP012.md)| Don't use [controller]. -| [ASP013](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP013.md)| Name the controller to match the route. +| [ASP001](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP001.md)| Parameter name does not match the name specified by the route parameter +| [ASP002](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP002.md)| Route parameter name does not match the method parameter name +| [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 +| [ASP004](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP004.md)| Route parameter type does not match the method parameter type +| [ASP005](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP005.md)| Syntax error in parameter +| [ASP006](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP006.md)| Escape constraint regex +| [ASP007](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP007.md)| The method has no corresponding parameter +| [ASP008](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP008.md)| Invalid route parameter name +| [ASP009](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP009.md)| Use kebab-cased urls +| [ASP010](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP010.md)| Unexpected character in url +| [ASP011](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP011.md)| Route parameter appears more than once +| [ASP012](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP012.md)| Don't use [controller] +| [ASP013](https://github.com/DotNetAnalyzers/AspNetCoreAnalyzers/tree/master/documentation/ASP013.md)| Name the controller to match the route ## Using AspNetCoreAnalyzers diff --git a/documentation/ASP001.md b/documentation/ASP001.md index 1d2dcf2..dcc0a0f 100644 --- a/documentation/ASP001.md +++ b/documentation/ASP001.md @@ -1,5 +1,5 @@ # ASP001 -## Parameter name does not match the name specified by the route parameter. +## Parameter name does not match the name specified by the route parameter | Topic | Value | :-- | :-- @@ -58,21 +58,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter. +#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter Code violating the rule here -#pragma warning restore ASP001 // Parameter name does not match the name specified by the route parameter. +#pragma warning restore ASP001 // Parameter name does not match the name specified by the route parameter ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter. +#pragma warning disable ASP001 // Parameter name does not match the name specified by the route parameter ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP001:Parameter name does not match the name specified by the route parameter.", + "ASP001:Parameter name does not match the name specified by the route parameter", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP002.md b/documentation/ASP002.md index ac6a8db..fa0e7cc 100644 --- a/documentation/ASP002.md +++ b/documentation/ASP002.md @@ -1,5 +1,5 @@ # ASP002 -## Route parameter name does not match the method parameter name. +## Route parameter name does not match the method parameter name | Topic | Value | :-- | :-- @@ -58,21 +58,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP002 // Route parameter name does not match the method parameter name. +#pragma warning disable ASP002 // Route parameter name does not match the method parameter name Code violating the rule here -#pragma warning restore ASP002 // Route parameter name does not match the method parameter name. +#pragma warning restore ASP002 // Route parameter name does not match the method parameter name ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP002 // Route parameter name does not match the method parameter name. +#pragma warning disable ASP002 // Route parameter name does not match the method parameter name ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP002:Route parameter name does not match the method parameter name.", + "ASP002:Route parameter name does not match the method parameter name", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP003.md b/documentation/ASP003.md index 36a36d8..1d8d294 100644 --- a/documentation/ASP003.md +++ b/documentation/ASP003.md @@ -1,5 +1,5 @@ # ASP003 -## Parameter type does not match the type specified by the name specified by the route parameter. +## Parameter type does not match the type specified by the name specified by the route parameter | Topic | Value | :-- | :-- @@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter. +#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter Code violating the rule here -#pragma warning restore ASP003 // Parameter type does not match the type specified by the name specified by the route parameter. +#pragma warning restore ASP003 // Parameter type does not match the type specified by the name specified by the route parameter ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter. +#pragma warning disable ASP003 // Parameter type does not match the type specified by the name specified by the route parameter ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP003:Parameter type does not match the type specified by the name specified by the route parameter.", + "ASP003:Parameter type does not match the type specified by the name specified by the route parameter", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP004.md b/documentation/ASP004.md index 8bad316..d17862b 100644 --- a/documentation/ASP004.md +++ b/documentation/ASP004.md @@ -1,5 +1,5 @@ # ASP004 -## Route parameter type does not match the method parameter type. +## Route parameter type does not match the method parameter type | Topic | Value | :-- | :-- @@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP004 // Route parameter type does not match the method parameter type. +#pragma warning disable ASP004 // Route parameter type does not match the method parameter type Code violating the rule here -#pragma warning restore ASP004 // Route parameter type does not match the method parameter type. +#pragma warning restore ASP004 // Route parameter type does not match the method parameter type ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP004 // Route parameter type does not match the method parameter type. +#pragma warning disable ASP004 // Route parameter type does not match the method parameter type ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP004:Route parameter type does not match the method parameter type.", + "ASP004:Route parameter type does not match the method parameter type", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP005.md b/documentation/ASP005.md index 2fe788f..eb280f0 100644 --- a/documentation/ASP005.md +++ b/documentation/ASP005.md @@ -1,5 +1,5 @@ # ASP005 -## Syntax error in parameter. +## Syntax error in parameter | Topic | Value | :-- | :-- @@ -47,21 +47,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP005 // Syntax error in parameter. +#pragma warning disable ASP005 // Syntax error in parameter Code violating the rule here -#pragma warning restore ASP005 // Syntax error in parameter. +#pragma warning restore ASP005 // Syntax error in parameter ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP005 // Syntax error in parameter. +#pragma warning disable ASP005 // Syntax error in parameter ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP005:Syntax error in parameter.", + "ASP005:Syntax error in parameter", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP006.md b/documentation/ASP006.md index 429a55c..0409c58 100644 --- a/documentation/ASP006.md +++ b/documentation/ASP006.md @@ -1,5 +1,5 @@ # ASP006 -## Escape constraint regex. +## Escape constraint regex | Topic | Value | :-- | :-- @@ -45,21 +45,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP006 // Escape constraint regex. +#pragma warning disable ASP006 // Escape constraint regex Code violating the rule here -#pragma warning restore ASP006 // Escape constraint regex. +#pragma warning restore ASP006 // Escape constraint regex ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP006 // Escape constraint regex. +#pragma warning disable ASP006 // Escape constraint regex ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP006:Escape constraint regex.", + "ASP006:Escape constraint regex", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP007.md b/documentation/ASP007.md index bccd88d..74d2112 100644 --- a/documentation/ASP007.md +++ b/documentation/ASP007.md @@ -1,5 +1,5 @@ # ASP007 -## The method has no corresponding parameter. +## The method has no corresponding parameter | Topic | Value | :-- | :-- @@ -44,21 +44,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP007 // The method has no corresponding parameter. +#pragma warning disable ASP007 // The method has no corresponding parameter Code violating the rule here -#pragma warning restore ASP007 // The method has no corresponding parameter. +#pragma warning restore ASP007 // The method has no corresponding parameter ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP007 // The method has no corresponding parameter. +#pragma warning disable ASP007 // The method has no corresponding parameter ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP007:The method has no corresponding parameter.", + "ASP007:The method has no corresponding parameter", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP008.md b/documentation/ASP008.md index 27df746..98e880b 100644 --- a/documentation/ASP008.md +++ b/documentation/ASP008.md @@ -1,5 +1,5 @@ # ASP008 -## Invalid route parameter name. +## Invalid route parameter name | Topic | Value | :-- | :-- @@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP008 // Invalid route parameter name. +#pragma warning disable ASP008 // Invalid route parameter name Code violating the rule here -#pragma warning restore ASP008 // Invalid route parameter name. +#pragma warning restore ASP008 // Invalid route parameter name ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP008 // Invalid route parameter name. +#pragma warning disable ASP008 // Invalid route parameter name ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP008:Invalid route parameter name.", + "ASP008:Invalid route parameter name", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP009.md b/documentation/ASP009.md index dd3f247..ac43622 100644 --- a/documentation/ASP009.md +++ b/documentation/ASP009.md @@ -1,5 +1,5 @@ # ASP009 -## Use kebab-cased urls. +## Use kebab-cased urls | Topic | Value | :-- | :-- @@ -45,21 +45,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP009 // Use kebab-cased urls. +#pragma warning disable ASP009 // Use kebab-cased urls Code violating the rule here -#pragma warning restore ASP009 // Use kebab-cased urls. +#pragma warning restore ASP009 // Use kebab-cased urls ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP009 // Use kebab-cased urls. +#pragma warning disable ASP009 // Use kebab-cased urls ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP009:Use kebab-cased urls.", + "ASP009:Use kebab-cased urls", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP010.md b/documentation/ASP010.md index 296ae6b..527222f 100644 --- a/documentation/ASP010.md +++ b/documentation/ASP010.md @@ -1,5 +1,5 @@ # ASP010 -## Unexpected character in url. +## Unexpected character in url | Topic | Value | :-- | :-- @@ -38,21 +38,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP010 // Unexpected character in url. +#pragma warning disable ASP010 // Unexpected character in url Code violating the rule here -#pragma warning restore ASP010 // Unexpected character in url. +#pragma warning restore ASP010 // Unexpected character in url ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP010 // Unexpected character in url. +#pragma warning disable ASP010 // Unexpected character in url ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP010:Unexpected character in url.", + "ASP010:Unexpected character in url", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP011.md b/documentation/ASP011.md index 308f95d..c7731a9 100644 --- a/documentation/ASP011.md +++ b/documentation/ASP011.md @@ -1,5 +1,5 @@ # ASP011 -## Route parameter appears more than once. +## Route parameter appears more than once | Topic | Value | :-- | :-- @@ -36,21 +36,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP011 // Route parameter appears more than once. +#pragma warning disable ASP011 // Route parameter appears more than once Code violating the rule here -#pragma warning restore ASP011 // Route parameter appears more than once. +#pragma warning restore ASP011 // Route parameter appears more than once ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP011 // Route parameter appears more than once. +#pragma warning disable ASP011 // Route parameter appears more than once ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP011:Route parameter appears more than once.", + "ASP011:Route parameter appears more than once", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP012.md b/documentation/ASP012.md index c7277d9..48eab4e 100644 --- a/documentation/ASP012.md +++ b/documentation/ASP012.md @@ -1,5 +1,5 @@ # ASP012 -## Don't use [controller]. +## Don't use [controller] | Topic | Value | :-- | :-- @@ -45,21 +45,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP012 // Don't use [controller]. +#pragma warning disable ASP012 // Don't use [controller] Code violating the rule here -#pragma warning restore ASP012 // Don't use [controller]. +#pragma warning restore ASP012 // Don't use [controller] ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP012 // Don't use [controller]. +#pragma warning disable ASP012 // Don't use [controller] ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP012:Don't use [controller].", + "ASP012:Don't use [controller]", Justification = "Reason...")] ``` \ No newline at end of file diff --git a/documentation/ASP013.md b/documentation/ASP013.md index 7c235ff..104bacc 100644 --- a/documentation/ASP013.md +++ b/documentation/ASP013.md @@ -1,5 +1,5 @@ # ASP013 -## Name the controller to match the route. +## Name the controller to match the route | Topic | Value | :-- | :-- @@ -46,21 +46,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros ### Via #pragma directive. ```C# -#pragma warning disable ASP013 // Name the controller to match the route. +#pragma warning disable ASP013 // Name the controller to match the route Code violating the rule here -#pragma warning restore ASP013 // Name the controller to match the route. +#pragma warning restore ASP013 // Name the controller to match the route ``` Or put this at the top of the file to disable all instances. ```C# -#pragma warning disable ASP013 // Name the controller to match the route. +#pragma warning disable ASP013 // Name the controller to match the route ``` ### Via attribute `[SuppressMessage]`. ```C# [System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing", - "ASP013:Name the controller to match the route.", + "ASP013:Name the controller to match the route", Justification = "Reason...")] ``` \ No newline at end of file