chore(checkstyle): enable NeedBraces rule

All bodies of if/else/while/for/do must now be wrapped in braces.
The preceding commit fixed all 197 pre-existing violations, so
checkstyleMain passes with zero errors. Removed the corresponding
entry from the disabled-rules backlog comment.
This commit is contained in:
zkpaiminmin
2026-05-07 22:18:42 +08:00
parent 8c6747c28b
commit 84c2b03546
+8 -4
View File
@@ -97,6 +97,14 @@
<!-- Remove redundant modifiers (e.g. public on interface methods) -->
<module name="RedundantModifier"/>
<!-- ===== Block Style ===== -->
<!-- Require braces around all if/else/while/for/do bodies. Guards against
goto-fail-style bugs where a future edit silently slips outside the
conditional. The 197 pre-existing single-line violations were fixed
in the preceding commit. -->
<module name="NeedBraces"/>
<!-- ===== Regexp ===== -->
<!--
@@ -133,10 +141,6 @@
- InnerTypeLastCheck (~628 violations)
Reason: pure code-ordering preference, no functional benefit.
- NeedBraces (~197 violations)
Reason: useful safety net but requires touching many single-line if statements.
Consider re-enabling after a dedicated cleanup pass.
- NestedIfDepth / NestedTryDepth (~26 violations)
Reason: real refactoring required, schedule separately.