You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rules/Proj0039.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ancestor: MSBuild
8
8
MSBuild can be configured to [threat all warnings as errors](https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/errors-warnings#treatwarningsaserrors).
9
9
How tempting this may feel (ideally a solution should not contain any warnings), there are some objections to consider. Because such a policy might be counterproductive.
10
10
11
-
## 1. We’re not developing in a perfect world
11
+
## 1. We’re not developing in a perfect world
12
12
When a warning pops up, the developer facing it, should solve the issue. That why we have static code analysis enabled after all. The fact that this is not happening hints that we do not live in a perfect world. By changing the severity to error for all rules, the world we live in will not change.
13
13
14
14
A developer that was not willing to resolve a warning is most likely also not willing to resolve an error beyond the bare minimum: that means by suppressing the issue, disabling the rule, or by adjusting the code just to satisfy the rule, none of these resolutions is guaranteed to be an improvement.
@@ -28,7 +28,7 @@ It is possible to create static code analysis with an error severity. The reason
28
28
Some extensions in Visual Studio (like VS Spell Checker or SonarQube IDE) add warnings to the build output as they are de facto analysers. As they are not configured by the solution but by the environment of the developer, those developers can not build the solution.
29
29
30
30
## 6. False positives
31
-
Although analyser rule builders – like us – try their best to come up with robust and correct analysers, it turns out that now and then a rule reports a false positive. In such cases it is better to not to have to supress the issue, or to adjust the code just so satisfy the rule, but to file a bug report and wait for an update that fixes the FP.
31
+
Although analyser rule builders – like us – try their best to come up with robust and correct analysers, it turns out that now and then a rule reports a false positive. In such cases it is better to not to have to supress the issue, or to adjust the code just so satisfy the rule, but to file a bug report and wait for an update that fixes the FP.
32
32
33
33
In the end, warnings are an indication as technical debt, and should be handled a such: with care. Using tools like Qodana and SonarQube can create reports on pull requests to reduce the introduction of new warnings (ideally to zero).
34
34
@@ -40,7 +40,7 @@ On a regular basis the team working on the project should allocate time to addre
0 commit comments