Skip to content

Commit be2f20d

Browse files
CornielLauraXiulan
andauthored
Update rules/Proj0039.md
Co-authored-by: Laura Kramer <[email protected]>
1 parent 04409b1 commit be2f20d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rules/Proj0039.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ancestor: MSBuild
88
MSBuild can be configured to [threat all warnings as errors]( https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/errors-warnings#treatwarningsaserrors).
99
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.
1010

11-
## 1. We’re not developing in a perfect world
11+
## 1. We’re not developing in a perfect world
1212
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.
1313

1414
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
2828
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.
2929

3030
## 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.
3232

3333
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).
3434

@@ -40,7 +40,7 @@ On a regular basis the team working on the project should allocate time to addre
4040

4141
<PropertyGroup>
4242
<TargetFramework>net8.0</TargetFramework>
43-
<TreatWarningsAsErrors>true</ TreatWarningsAsErrors>
43+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4444
</PropertyGroup>
4545

4646
</Project>

0 commit comments

Comments
 (0)