From b60dff32a2abd0f86591c2536c35a4b9f0249e64 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 17 Nov 2024 02:41:25 +0000 Subject: [PATCH 1/7] chore(deps): update dependency microsoft.codeanalysis.netanalyzers to v9 --- Workleap.DotNet.CodingStandards.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workleap.DotNet.CodingStandards.nuspec b/Workleap.DotNet.CodingStandards.nuspec index f7f9a7f..61c0cf1 100644 --- a/Workleap.DotNet.CodingStandards.nuspec +++ b/Workleap.DotNet.CodingStandards.nuspec @@ -14,7 +14,7 @@ - + From 6949eeaec1426746a9c447b53f4376f24f87a36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:29:34 -0500 Subject: [PATCH 2/7] update rule files with new rules --- ...oft.CodeAnalysis.NetAnalyzers.editorconfig | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/files/analyzers/Analyzer.Microsoft.CodeAnalysis.NetAnalyzers.editorconfig b/src/files/analyzers/Analyzer.Microsoft.CodeAnalysis.NetAnalyzers.editorconfig index 81094d4..dc7feb7 100644 --- a/src/files/analyzers/Analyzer.Microsoft.CodeAnalysis.NetAnalyzers.editorconfig +++ b/src/files/analyzers/Analyzer.Microsoft.CodeAnalysis.NetAnalyzers.editorconfig @@ -395,6 +395,16 @@ dotnet_diagnostic.CA1512.severity = warning # Enabled: True, Severity: suggestion dotnet_diagnostic.CA1513.severity = warning +# CA1514: Avoid redundant length argument +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1514 +# Enabled: True, Severity: suggestion +dotnet_diagnostic.CA1514.severity = suggestion + +# CA1515: Consider making public types internal +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515 +# Enabled: False, Severity: warning +dotnet_diagnostic.CA1515.severity = none + # CA1700: Do not name enum values 'Reserved' # Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1700 # Enabled: False, Severity: warning @@ -781,6 +791,16 @@ dotnet_diagnostic.CA1869.severity = warning # Enabled: True, Severity: suggestion dotnet_diagnostic.CA1870.severity = warning +# CA1871: Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1871 +# Enabled: True, Severity: suggestion +dotnet_diagnostic.CA1871.severity = suggestion + +# CA1872: Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1872 +# Enabled: True, Severity: suggestion +dotnet_diagnostic.CA1872.severity = suggestion + # CA2000: Dispose objects before losing scope # Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000 # Enabled: False, Severity: warning @@ -864,6 +884,11 @@ dotnet_diagnostic.CA2020.severity = warning # Enabled: True, Severity: warning dotnet_diagnostic.CA2021.severity = warning +# CA2022: Avoid inexact read with 'Stream.Read' +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022 +# Enabled: True, Severity: warning +dotnet_diagnostic.CA2022.severity = warning + # CA2100: Review SQL queries for security vulnerabilities # Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2100 # Enabled: False, Severity: warning @@ -1091,6 +1116,26 @@ dotnet_diagnostic.CA2260.severity = warning # Enabled: True, Severity: warning dotnet_diagnostic.CA2261.severity = warning +# CA2262: Set 'MaxResponseHeadersLength' properly +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2262 +# Enabled: True, Severity: suggestion +dotnet_diagnostic.CA2262.severity = suggestion + +# CA2263: Prefer generic overload when type is known +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2263 +# Enabled: True, Severity: suggestion +dotnet_diagnostic.CA2263.severity = suggestion + +# CA2264: Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull' +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2264 +# Enabled: True, Severity: warning +dotnet_diagnostic.CA2264.severity = warning + +# CA2265: Do not compare Span to 'null' or 'default' +# Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2265 +# Enabled: True, Severity: warning +dotnet_diagnostic.CA2265.severity = warning + # CA2300: Do not use insecure deserializer BinaryFormatter # Help link: https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2300 # Enabled: False, Severity: warning From 9093a7d3e4f10f8e75c4c668e887b94c29a22613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:31:04 -0500 Subject: [PATCH 3/7] Prevent useless warning --- src/build/Workleap.DotNet.CodingStandards.props | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/build/Workleap.DotNet.CodingStandards.props b/src/build/Workleap.DotNet.CodingStandards.props index d5cbe4a..1ce8753 100644 --- a/src/build/Workleap.DotNet.CodingStandards.props +++ b/src/build/Workleap.DotNet.CodingStandards.props @@ -9,6 +9,9 @@ true snupkg + + <_SkipUpgradeNetAnalyzersNuGetWarning>true + true From f7db19e7973153ad0d6642c7daaa2f17ae04caf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:33:00 -0500 Subject: [PATCH 4/7] fix --- .github/workflows/semgrep.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index 289755b..ac80770 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -10,5 +10,6 @@ on: jobs: call-workflow-semgrep: permissions: + contents: read security-events: write uses: gsoft-inc/wl-reusable-workflows/.github/workflows/reusable-semgrep-workflow.yml@main From d607a8d6592687dbf298edc372062dda30c186a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:39:25 -0500 Subject: [PATCH 5/7] wip --- Directory.Build.props | 4 ++-- .../Workleap.DotNet.CodingStandards.Tests.csproj | 2 +- .../ConfigurationFilesGenerator.csproj | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index d9ad06f..cb2cf90 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,6 @@ - + - \ No newline at end of file + diff --git a/tests/Workleap.DotNet.CodingStandards.Tests/Workleap.DotNet.CodingStandards.Tests.csproj b/tests/Workleap.DotNet.CodingStandards.Tests/Workleap.DotNet.CodingStandards.Tests.csproj index 0e9a75c..7b4cfa8 100644 --- a/tests/Workleap.DotNet.CodingStandards.Tests/Workleap.DotNet.CodingStandards.Tests.csproj +++ b/tests/Workleap.DotNet.CodingStandards.Tests/Workleap.DotNet.CodingStandards.Tests.csproj @@ -8,7 +8,7 @@ - + all diff --git a/tools/ConfigurationFilesGenerator/ConfigurationFilesGenerator.csproj b/tools/ConfigurationFilesGenerator/ConfigurationFilesGenerator.csproj index db9c791..177774c 100644 --- a/tools/ConfigurationFilesGenerator/ConfigurationFilesGenerator.csproj +++ b/tools/ConfigurationFilesGenerator/ConfigurationFilesGenerator.csproj @@ -8,12 +8,12 @@ - + - + From e1980c1b1dadffe1891e5e98919d5a286ebc4be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:41:29 -0500 Subject: [PATCH 6/7] trigger a new pipeline with a new sha From d7c38d1c3c5a3a787614033cd312b931dfb1e150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Thu, 28 Nov 2024 10:44:01 -0500 Subject: [PATCH 7/7] fix --- Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.ps1 b/Build.ps1 index 25271b6..23b4020 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -38,7 +38,7 @@ Process { # Push to a NuGet feed if the environment variables are set if (($null -ne $env:NUGET_SOURCE ) -and ($null -ne $env:NUGET_API_KEY)) { - Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY } + Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY --skip-duplicate } } } finally {