From 57603d31b63e8ed66644d106b75d56134b47ec29 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Mon, 3 Jun 2024 14:04:17 +0200 Subject: [PATCH 1/2] feat: updating webapi project-framework rules --- .../project-frameworks/webapi/.editorconfig | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/distribution/project-frameworks/webapi/.editorconfig b/distribution/project-frameworks/webapi/.editorconfig index 53b063e..7739451 100644 --- a/distribution/project-frameworks/webapi/.editorconfig +++ b/distribution/project-frameworks/webapi/.editorconfig @@ -1,6 +1,6 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.1 -# Updated: 08-04-2024 +# Version: 1.0.2 +# Updated: 03-06-2024 # Location: webapi # Distribution: Frameworks @@ -16,3 +16,28 @@ dotnet_diagnostic.MA0004.severity = none # Use Task.ConfigureAwait(fa ########################################## # Custom - Code Analyzers Rules ########################################## + +dotnet_diagnostic.ASP0000.severity = error # Do not call 'IServiceCollection.BuildServiceProvider' in 'ConfigureServices' - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0000?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0001.severity = error # Authorization middleware is incorrectly configured - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/ASP0001?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0003.severity = error # Do not use model binding attributes with route handlers - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0003?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0004.severity = error # Do not use action results with route handlers - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0004?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0005.severity = error # Do not place attribute on method called by route handler lambda - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0005?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0007.severity = error # Route parameter and argument optionality is mismatched - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0007?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0008.severity = error # Do not use ConfigureWebHost with WebApplicationBuilder.Host - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0008?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0009.severity = error # Do not use Configure with WebApplicationBuilder.WebHost - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0009?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0010.severity = error # Do not use UseStartup with WebApplicationBuilder.WebHost - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0010?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0011.severity = suggestion # Suggest using builder.Logging over Host.ConfigureLogging or WebHost.ConfigureLogging - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0011?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0012.severity = suggestion # Suggest using builder.Services over Host.ConfigureServices or WebHost.ConfigureServices - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0012?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0013.severity = suggestion # Suggest switching from using Configure methods to WebApplicationBuilder.Configuration - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0013?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0014.severity = suggestion # Suggest using top level route registrations - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0014?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0015.severity = suggestion # Suggest using IHeaderDictionary properties - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0015?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0016.severity = error # Do not return a value from RequestDelegate - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0016?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0017.severity = error # Invalid route pattern - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0017?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0018.severity = suggestion # Unused route parameter - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0018?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0019.severity = suggestion # Suggest using IHeaderDictionary.Append or the indexer - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0019?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0020.severity = none # Complex types referenced by route parameters must be parsable - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0020?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0021.severity = none # The return type of the BindAsync method must be ValueTask - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0021?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0022.severity = error # Route conflict detected between route handlers (Minimal API) - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0022?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0023.severity = error # Route conflict detected between route handlers (MVC) - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0023?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0024.severity = error # Route handler has multiple parameters with the [FromBody] attribute - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0024?view=aspnetcore-8.0 +dotnet_diagnostic.ASP0025.severity = suggestion # Use AddAuthorizationBuilder to register authorization services and construct policies - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0025?view=aspnetcore-8.0 \ No newline at end of file From b796129857086f6ae463f1c394c30037e54d9769 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Mon, 3 Jun 2024 14:04:23 +0200 Subject: [PATCH 2/2] feat: updating blazor project-framework rules --- .../project-frameworks/blazor/.editorconfig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/distribution/project-frameworks/blazor/.editorconfig b/distribution/project-frameworks/blazor/.editorconfig index f7cc31e..9165e9d 100644 --- a/distribution/project-frameworks/blazor/.editorconfig +++ b/distribution/project-frameworks/blazor/.editorconfig @@ -1,6 +1,6 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.0 -# Updated: 27-03-2024 +# Version: 1.0.1 +# Updated: 03-06-2024 # Location: blazor # Distribution: Frameworks @@ -14,3 +14,12 @@ dotnet_diagnostic.MA0048.severity = none # To support code-behind [co ########################################## # Custom - Code Analyzers Rules ########################################## + +dotnet_diagnostic.BL0001.severity = error # Component parameter should have public setters - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0001?view=aspnetcore-8.0 +dotnet_diagnostic.BL0002.severity = error # Component has multiple CaptureUnmatchedValues parameters - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0002?view=aspnetcore-8.0 +dotnet_diagnostic.BL0003.severity = error # Component parameter with CaptureUnmatchedValues has the wrong type - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0003?view=aspnetcore-8.0 +dotnet_diagnostic.BL0004.severity = error # Component parameter should be public - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0004?view=aspnetcore-8.0 +dotnet_diagnostic.BL0005.severity = error # Component parameter should not be set outside of its component - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0005?view=aspnetcore-8.0 +dotnet_diagnostic.BL0006.severity = warning # Do not use RenderTree types - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0006?view=aspnetcore-8.0 + +dotnet_diagnostic.ASP0006.severity = suggestion # Do not use non-literal sequence numbers - https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0006?view=aspnetcore-8.0 \ No newline at end of file