During development it can be tedious to make the code adhere to all the static code analysis rules we have. We'd love instead to then make all of the static code analysis rules be treated as warnings when doing locally building when developing, while when we push and the build runs on our CI, we want it to treat them as errors.
It would be great if there was a similar MSBuild option to the <TreatWarningsAsErrors/>
just flipped e.g. <TreatErrorsAsWarnings/>
, preferably in MSBuild since we have packaged up our rules into a common package used by all projects.
Having to maintain a separate ruleset for this scenario is too much of a hassle.
Right now we are actually turning off all rules locally and only have them on for our CI. This then requires discipline from every developer to remember to build it locally for release to get the errors in the code before pushing. While warnings would be very visible all the time and a friendly reminder to fix them before pushing.