In my team I want to prevent developer to check-in code with warnings from code analysis.
Like I found in some blogs and stackoverflow-questions I tried to make this with a check-in policy:
- Enable Code Analysis in Visual Studio Project and set the Rulset (Microsoft Minimum Recommended Rules)
- Add Check-in Policy "Code Analysis" and set the same Ruleset (Microsoft Minimum Recommended Rules).
The Problem now I have is, that the policy only prevent checkin if there are errors, but not if there are only warnings. Of course I can change the ruleset and set all rules as errors. But then also local builds are not possible.
So, what I want is that that the rules all are warnings and building the project is possible but check-in is prevented also if only warning exists.
My idea was, to set a different ruleset in checkin policy settings (same rules but all rules as error). But by trying check-in y get the error: Code analysis settings are not compatible with code analysis policy.
So my question is, if somebody has a solution or idea how I can solve this problem.
Thanks in advance for your answer!