From 38b5f16cccd82500a67807fe9aaafe8c5ba03a31 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 16 Mar 2023 10:42:52 +1000 Subject: [PATCH] Refactor enable Roslyn Analyzers flag kept the old name, but turns out `-p:RunAnalyzersDuringBuild=true` also works ...good thing the old name wasn't documented --- .gitlab-ci.yml | 2 +- Common.props | 2 +- Dist/QuickTestBuildAndPackage.bat | 2 +- ExternalProjects/LibCommon.props | 1 - ExternalToolProjects/ExtToolCommon.props | 1 - contributing.md | 3 ++- src/MainSlnCommon.props | 3 +++ 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3387039dc..28b0d068c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,7 +101,7 @@ check_style: script: - cd src/BizHawk.Version - dotnet build -c Release # configuration doesn't really matter as the assembly is empty - - ../../Dist/BuildRelease.sh -p:MachineRunAnalyzersDuringBuild=true + - ../../Dist/BuildRelease.sh -p:RunAnalyzersDuringBuild=true stage: test .disabled_job_infersharp: diff --git a/Common.props b/Common.props index a255e6b13f..f678347bc7 100644 --- a/Common.props +++ b/Common.props @@ -11,7 +11,7 @@ SA0001 enable AnyCPU - false + true false diff --git a/Dist/QuickTestBuildAndPackage.bat b/Dist/QuickTestBuildAndPackage.bat index 927d5f5528..72854d3908 100644 --- a/Dist/QuickTestBuildAndPackage.bat +++ b/Dist/QuickTestBuildAndPackage.bat @@ -12,7 +12,7 @@ git --version > NUL dotnet build ..\BizHawk.sln -c Release --no-incremental @if not errorlevel 0 goto DOTNETBUILDFAILED rem -p:Platform="Any CPU" -rem -p:MachineRunAnalyzersDuringBuild=true +rem -p:RunAnalyzersDuringBuild=true rem we have to do this twice right now dotnet build ..\BizHawk.sln -c Release diff --git a/ExternalProjects/LibCommon.props b/ExternalProjects/LibCommon.props index 3ec6b6cfb4..e60a37bd14 100644 --- a/ExternalProjects/LibCommon.props +++ b/ExternalProjects/LibCommon.props @@ -2,7 +2,6 @@ $(NoWarn);SA1200 - true diff --git a/ExternalToolProjects/ExtToolCommon.props b/ExternalToolProjects/ExtToolCommon.props index 55baa7dcee..0674912099 100644 --- a/ExternalToolProjects/ExtToolCommon.props +++ b/ExternalToolProjects/ExtToolCommon.props @@ -2,7 +2,6 @@ $(ProjectDir)bin/$(Configuration)/ - true diff --git a/contributing.md b/contributing.md index b0d800ae85..ff94122ffe 100644 --- a/contributing.md +++ b/contributing.md @@ -114,7 +114,8 @@ On the command-line, from root of the repo run `Dist/BuildRelease.sh` (Unix) or There are 2 build configurations. Besides `Release` there is `Debug`, which *does not run* bytecode optimisations, *does not remove* debugging symbols, *enables* additional logging and assertions, and *enables* some features. On Windows, a `Debug` executable will spawn a console window for stdout. Note there is also a "stronger" release build in the form of `VersionInfo.DeveloperBuild == false`, which is only used by GitLab CI for preparing a release (during `Dist/UpdateVersionInfoForRelease.sh`). We have an automated test suite in the solution which runs in CI, though you can and should run it before pushing. -There are also various Analyzers (static code analysis plugins) for detecting common mistakes and checking code style. Not every style rule is currently enabled, so please make sure you use CRLF, tabs, and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) (but don't try to fix code you're not working on). +There are also [various Analyzers](https://github.com/TASEmulators/BizHawk/wiki/Roslyn-Analyzers-(third-party)) (static code analysis plugins) for detecting common mistakes and checking code style. These are disabled by default for the main solution; pass `-p:RunAnalyzersDuringBuild=true` to the build script, or set the env. var `MachineRunAnalyzersDuringBuild=1`. +In addition, not every style rule is currently enabled, so please make sure you use CRLF, tabs, and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) (but don't try to fix code you're not working on). There are additional test suites specifically for regression-testing cores—these are not included in the solution and need to be run manually. See [the base project's readme](https://github.com/TASEmulators/BizHawk/blob/master/src/BizHawk.Tests.Testroms.GB/readme.md) for details. diff --git a/src/MainSlnCommon.props b/src/MainSlnCommon.props index 2b6fa506fb..4bab10c69d 100644 --- a/src/MainSlnCommon.props +++ b/src/MainSlnCommon.props @@ -10,6 +10,9 @@ $(ProjectDir)../../output/dll None + + false +