build: two-tier checkstyle gate, empty suppressions, fix baseline
Checkstyle is now a ratchet: severity="error" only for rules that are at zero violations, design-debt rules report as warnings and must be flipped to error as soon as their backlog hits zero (tracked in TODO.md). - thresholds tightened: MethodLength 80->40, CyclomaticComplexity 20->15, NestedIfDepth 3->2, ParameterNumber 7->5; new rules ReturnCount(5), FinalClass, HiddenField, VisibilityModifier; MagicNumber and FinalLocalVariable promoted from warning to error (both clean) - suppressions.xml emptied: 45 legacy entries removed, never add back - fixed 102 baseline violations (431->329): FinalClass in 37 classes, WhitespaceAround in 11 files - TODO.md: Task 1 done (lolib removed, smoke test passed) and Task 2 baseline recorded (red report, per-package list, next steps)
This commit is contained in:
parent
4d999c89a8
commit
e8b6569ccf
46 changed files with 279 additions and 147 deletions
|
|
@ -3,6 +3,24 @@
|
|||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
Two-tier gate (ratchet):
|
||||
|
||||
* severity="error" — rules that are at ZERO violations right now. The build
|
||||
fails if any of them fires. Strict thresholds live here; they were raised
|
||||
from the pre-Task-2 values (MethodLength 80->40, CyclomaticComplexity
|
||||
20->15, NestedIfDepth 3->2, ParameterNumber 7->5, MagicNumber and
|
||||
FinalLocalVariable promoted from warning to error).
|
||||
|
||||
* severity="warning" — the design-debt backlog: rules that are ON and report
|
||||
every violation in build/reports/checkstyle, but do not fail the build
|
||||
while their backlog is non-zero. Counts are tracked in TODO.md
|
||||
(Задача 2, блок «красный baseline»). When a rule reaches zero violations
|
||||
it MUST be flipped to severity="error" in this file.
|
||||
|
||||
suppressions.xml is intentionally empty — never add entries back; fix the
|
||||
code or, for a documented intentional pattern, agree on it with the owner.
|
||||
-->
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<property name="severity" value="error"/>
|
||||
|
|
@ -17,11 +35,8 @@
|
|||
<property name="max" value="200"/>
|
||||
</module>
|
||||
|
||||
<!-- Legacy files that still exceed 200 lines. Remove entries as they get
|
||||
decomposed; new files must already comply and must NOT be added here. -->
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file"
|
||||
value="${config_loc}/suppressions.xml"/>
|
||||
<property name="file" value="${config_loc}/suppressions.xml"/>
|
||||
<property name="optional" value="true"/>
|
||||
</module>
|
||||
|
||||
|
|
@ -37,16 +52,23 @@
|
|||
<module name="SuppressWarningsHolder"/>
|
||||
|
||||
<module name="MethodLength">
|
||||
<property name="max" value="80"/>
|
||||
<property name="max" value="40"/>
|
||||
<property name="countEmpty" value="false"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="CyclomaticComplexity">
|
||||
<property name="max" value="20"/>
|
||||
<property name="max" value="15"/>
|
||||
</module>
|
||||
|
||||
<module name="ParameterNumber">
|
||||
<property name="max" value="7"/>
|
||||
<property name="max" value="5"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="ReturnCount">
|
||||
<property name="max" value="5"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="AvoidStarImport"/>
|
||||
|
|
@ -86,6 +108,18 @@
|
|||
<module name="ArrayTypeStyle"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="FinalClass"/>
|
||||
|
||||
<module name="HiddenField">
|
||||
<property name="ignoreConstructorParameter" value="true"/>
|
||||
<property name="ignoreSetter" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="VisibilityModifier">
|
||||
<property name="allowPublicFinalFields" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="text"/>
|
||||
|
|
@ -102,9 +136,10 @@
|
|||
<!-- ============ Complexity and size ============ -->
|
||||
<module name="NPathComplexity">
|
||||
<property name="max" value="50"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
<module name="NestedIfDepth">
|
||||
<property name="max" value="3"/>
|
||||
<property name="max" value="2"/>
|
||||
</module>
|
||||
<module name="NestedForDepth">
|
||||
<property name="max" value="2"/>
|
||||
|
|
@ -113,11 +148,11 @@
|
|||
<property name="max" value="2"/>
|
||||
</module>
|
||||
<module name="ClassDataAbstractionCoupling">
|
||||
<property name="max" value="25"/>
|
||||
<property name="max" value="10"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
<module name="ClassFanOutComplexity">
|
||||
<property name="max" value="30"/>
|
||||
<property name="max" value="12"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
|
|
@ -126,7 +161,6 @@
|
|||
<property name="ignoreNumbers" value="-1, 0, 1, 2"/>
|
||||
<property name="ignoreHashCodeMethod" value="true"/>
|
||||
<property name="ignoreAnnotation" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
<module name="Regexp">
|
||||
<property name="format" value="System\.(out|err)\.print"/>
|
||||
|
|
@ -142,6 +176,7 @@
|
|||
<module name="IllegalCatch">
|
||||
<property name="illegalClassNames"
|
||||
value="java.lang.Exception, java.lang.Throwable, java.lang.RuntimeException"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
|
||||
<!-- ============ Style and maintainability ============ -->
|
||||
|
|
@ -158,7 +193,6 @@
|
|||
</module>
|
||||
<module name="FinalLocalVariable">
|
||||
<property name="validateEnhancedForLoopVariable" value="true"/>
|
||||
<property name="severity" value="warning"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue