From 937754e46a83295de98f01a959f0f452540ca2a3 Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 13 Feb 2025 15:54:44 -0600 Subject: [PATCH 1/3] Code analysis fixes --- .github/workflows/ci.yml | 4 +++- src/IntegrationTests.HostV4/.editorconfig | 4 ++++ src/IntegrationTests.HostV4/GlobalSuppressions.cs | 8 -------- .../.editorconfig | 13 +++++++++++++ .../GlobalSuppressions.cs | 11 ----------- ...NServiceBus.AzureFunctions.Analyzer.Tests.csproj | 2 -- ...ceBus.AzureFunctions.InProcess.ServiceBus.csproj | 4 ++-- 7 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 src/IntegrationTests.HostV4/.editorconfig delete mode 100644 src/IntegrationTests.HostV4/GlobalSuppressions.cs create mode 100644 src/NServiceBus.AzureFunctions.Analyzer.Tests/.editorconfig delete mode 100644 src/NServiceBus.AzureFunctions.Analyzer.Tests/GlobalSuppressions.cs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28275fc3..72615f33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,9 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4.3.0 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 6.0.x - name: Setup Azure Functions Core Tools - Windows if: runner.os == 'Windows' run: | diff --git a/src/IntegrationTests.HostV4/.editorconfig b/src/IntegrationTests.HostV4/.editorconfig new file mode 100644 index 00000000..fb00cd90 --- /dev/null +++ b/src/IntegrationTests.HostV4/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] + +# ConfigureAwait(false) +dotnet_diagnostic.CA2007.severity = none diff --git a/src/IntegrationTests.HostV4/GlobalSuppressions.cs b/src/IntegrationTests.HostV4/GlobalSuppressions.cs deleted file mode 100644 index c7067373..00000000 --- a/src/IntegrationTests.HostV4/GlobalSuppressions.cs +++ /dev/null @@ -1,8 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "Test project", Scope = "module")] diff --git a/src/NServiceBus.AzureFunctions.Analyzer.Tests/.editorconfig b/src/NServiceBus.AzureFunctions.Analyzer.Tests/.editorconfig new file mode 100644 index 00000000..671d13ff --- /dev/null +++ b/src/NServiceBus.AzureFunctions.Analyzer.Tests/.editorconfig @@ -0,0 +1,13 @@ +[*.cs] + +# ConfigureAwait(false) +dotnet_diagnostic.CA2007.severity = none + +# Use pattern matching (may change code meaning) +dotnet_diagnostic.IDE0078.severity = none + +# Use pattern matching +dotnet_diagnostic.IDE0083.severity = none + +# Convert switch statement to expression +dotnet_diagnostic.IDE0066.severity = none diff --git a/src/NServiceBus.AzureFunctions.Analyzer.Tests/GlobalSuppressions.cs b/src/NServiceBus.AzureFunctions.Analyzer.Tests/GlobalSuppressions.cs deleted file mode 100644 index e3d15703..00000000 --- a/src/NServiceBus.AzureFunctions.Analyzer.Tests/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Style", "IDE0078:Use pattern matching (may change code meaning)", Justification = "")] -[assembly: SuppressMessage("Style", "IDE0083:Use pattern matching", Justification = "")] -[assembly: SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "")] -[assembly: SuppressMessage("Style", "IDE0066:Convert switch statement to expression", Justification = "")] diff --git a/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj b/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj index 34554741..8f90641a 100644 --- a/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj +++ b/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj @@ -2,8 +2,6 @@ net6.0 - true - ..\NServiceBusTests.snk diff --git a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBus.AzureFunctions.InProcess.ServiceBus.csproj b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBus.AzureFunctions.InProcess.ServiceBus.csproj index d412a593..6c9ee2ec 100644 --- a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBus.AzureFunctions.InProcess.ServiceBus.csproj +++ b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBus.AzureFunctions.InProcess.ServiceBus.csproj @@ -13,8 +13,8 @@ - + @@ -36,8 +36,8 @@ - + From b6ee368a489970433ce9c56b98f98716f5bf2b96 Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 13 Feb 2025 15:55:57 -0600 Subject: [PATCH 2/3] Sorting --- .../NServiceBus.AzureFunctions.Analyzer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj b/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj index 3e0be91b..71026d99 100644 --- a/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj +++ b/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj @@ -10,9 +10,9 @@ + - From 6a08bc3c1825025e53953363db0a606f800aecb0 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Thu, 13 Feb 2025 18:31:13 -0500 Subject: [PATCH 3/3] Tweaks --- .../NServiceBus.AzureFunctions.Analyzer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj b/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj index 71026d99..761ec1c2 100644 --- a/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj +++ b/src/NServiceBus.AzureFunctions.Analyzer/NServiceBus.AzureFunctions.Analyzer.csproj @@ -10,9 +10,9 @@ + -