From 2e8206f219f4675c7a3af7c72ae609d24c3ff8e3 Mon Sep 17 00:00:00 2001 From: Workleap <53535748+Infra-Workleap@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:59:40 -0500 Subject: [PATCH] chore(deps): update dependency microsoft.codeanalysis.netanalyzers to v9 (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --------- Co-authored-by: Renovate Bot Co-authored-by: Gérald Barré --- .github/workflows/semgrep.yml | 1 + Build.ps1 | 2 +- Directory.Build.props | 4 +- Workleap.DotNet.CodingStandards.nuspec | 2 +- .../Workleap.DotNet.CodingStandards.props | 3 ++ ...oft.CodeAnalysis.NetAnalyzers.editorconfig | 45 +++++++++++++++++++ ...rkleap.DotNet.CodingStandards.Tests.csproj | 2 +- .../ConfigurationFilesGenerator.csproj | 4 +- 8 files changed, 56 insertions(+), 7 deletions(-) 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 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 { 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/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 @@ - + 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 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 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 @@ - + - +