From 1a8b5254c0bcbe8cfbdc8a8f181d804440a10edf Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 10 Nov 2021 00:11:30 +0100 Subject: [PATCH 1/4] Disable GlobalPerProduct setting layer in cleanupcode/inspectcode --- Build.ps1 | 4 ++-- cleanupcode.ps1 | 2 +- inspectcode.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Build.ps1 b/Build.ps1 index 0cca69c095..906d00b4a2 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -8,7 +8,7 @@ function CheckLastExitCode { function RunInspectCode { $outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml') - dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal + dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal CheckLastExitCode [xml]$xml = Get-Content "$outputPath" @@ -47,7 +47,7 @@ function RunCleanupCode { $mergeCommitHash = git rev-parse "HEAD" $targetCommitHash = git rev-parse "$env:APPVEYOR_REPO_BRANCH" - dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff + dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN --jb -dsl=GlobalAll --jb -dsl=GlobalPerProduct --jb -dsl=SolutionPersonal --jb -dsl=ProjectPersonal -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff CheckLastExitCode } } diff --git a/cleanupcode.ps1 b/cleanupcode.ps1 index dccf70ebc1..544d398cc6 100644 --- a/cleanupcode.ps1 +++ b/cleanupcode.ps1 @@ -14,4 +14,4 @@ if ($LASTEXITCODE -ne 0) { throw "Package restore failed with exit code $LASTEXITCODE" } -dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN +dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN --jb -dsl=GlobalAll --jb -dsl=GlobalPerProduct --jb -dsl=SolutionPersonal --jb -dsl=ProjectPersonal diff --git a/inspectcode.ps1 b/inspectcode.ps1 index 6c9d90768e..16dccfd373 100644 --- a/inspectcode.ps1 +++ b/inspectcode.ps1 @@ -10,7 +10,7 @@ if ($LASTEXITCODE -ne 0) { $outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml') $resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html') -dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal +dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal if ($LASTEXITCODE -ne 0) { throw "Code inspection failed with exit code $LASTEXITCODE" From 037b58f8bdb42792bc969c3fa134a807c4865646 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 10 Nov 2021 00:11:53 +0100 Subject: [PATCH 2/4] Temporary code change to verify cleanupcode still fails in cibuild --- src/JsonApiDotNetCore/ArgumentGuard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonApiDotNetCore/ArgumentGuard.cs b/src/JsonApiDotNetCore/ArgumentGuard.cs index 1877078df9..f358d111f3 100644 --- a/src/JsonApiDotNetCore/ArgumentGuard.cs +++ b/src/JsonApiDotNetCore/ArgumentGuard.cs @@ -12,7 +12,7 @@ internal static class ArgumentGuard { [AssertionMethod] public static void NotNull([NoEnumeration] [SysNotNull] T? value, [InvokerParameterName] string name) - where T : class +where T : class { if (value is null) { From 6838cf9988071fe170b25c49014affc9d2fb6f77 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 10 Nov 2021 09:31:48 +0100 Subject: [PATCH 3/4] Revert "Temporary code change to verify cleanupcode still fails in cibuild" This reverts commit 037b58f8bdb42792bc969c3fa134a807c4865646. --- src/JsonApiDotNetCore/ArgumentGuard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonApiDotNetCore/ArgumentGuard.cs b/src/JsonApiDotNetCore/ArgumentGuard.cs index f358d111f3..1877078df9 100644 --- a/src/JsonApiDotNetCore/ArgumentGuard.cs +++ b/src/JsonApiDotNetCore/ArgumentGuard.cs @@ -12,7 +12,7 @@ internal static class ArgumentGuard { [AssertionMethod] public static void NotNull([NoEnumeration] [SysNotNull] T? value, [InvokerParameterName] string name) -where T : class + where T : class { if (value is null) { From d9d870ae64e03f4047017a74c31debd911f00561 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 17 Nov 2021 20:03:24 +0100 Subject: [PATCH 4/4] Adapted to latest version of ReGitLint --- .config/dotnet-tools.json | 2 +- Build.ps1 | 2 +- cleanupcode.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 571278c30c..0a05541b2e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "regitlint": { - "version": "2.1.4", + "version": "6.0.6", "commands": [ "regitlint" ] diff --git a/Build.ps1 b/Build.ps1 index 906d00b4a2..fa3c4e4f6c 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -47,7 +47,7 @@ function RunCleanupCode { $mergeCommitHash = git rev-parse "HEAD" $targetCommitHash = git rev-parse "$env:APPVEYOR_REPO_BRANCH" - dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN --jb -dsl=GlobalAll --jb -dsl=GlobalPerProduct --jb -dsl=SolutionPersonal --jb -dsl=ProjectPersonal -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff + dotnet regitlint -s JsonApiDotNetCore.sln --print-command --disable-jb-path-hack --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff CheckLastExitCode } } diff --git a/cleanupcode.ps1 b/cleanupcode.ps1 index 544d398cc6..6db01a863a 100644 --- a/cleanupcode.ps1 +++ b/cleanupcode.ps1 @@ -14,4 +14,4 @@ if ($LASTEXITCODE -ne 0) { throw "Package restore failed with exit code $LASTEXITCODE" } -dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN --jb -dsl=GlobalAll --jb -dsl=GlobalPerProduct --jb -dsl=SolutionPersonal --jb -dsl=ProjectPersonal +dotnet regitlint -s JsonApiDotNetCore.sln --print-command --disable-jb-path-hack --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN