diff --git a/Makefile b/Makefile index 697f846628..898b28f433 100644 --- a/Makefile +++ b/Makefile @@ -99,9 +99,11 @@ check: @echo @echo "Compiling in Debug mode..." ifeq ($(RUNTIME), mono) - @$(MSBUILD) -t:build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true +# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise. + @$(MSBUILD) -t:build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true else - @$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) +# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise. + @$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true endif ifeq ($(TARGETPLATFORM), unix-generic) @./configure-system-libraries.sh diff --git a/OpenRA.ruleset b/OpenRA.ruleset index 93fd24a1ed..10d9441655 100644 --- a/OpenRA.ruleset +++ b/OpenRA.ruleset @@ -1,8 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/make.ps1 b/make.ps1 index 19efd3d84f..4f2da72391 100644 --- a/make.ps1 +++ b/make.ps1 @@ -111,7 +111,9 @@ function Test-Command function Check-Command { Write-Host "Compiling in Debug configuration..." -ForegroundColor Cyan - dotnet build -c Debug --nologo -warnaserror -p:TargetPlatform=win-x64 + + # Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise. + dotnet build -c Debug --nologo -warnaserror -p:TargetPlatform=win-x64 -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true if ($lastexitcode -ne 0) { Write-Host "Build failed." -ForegroundColor Red