You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/10/02 03:28:40 UTC
(shardingsphere) branch master updated: Add Checkstyle rule against final test classes (#40035)
This is an automated email from the ASF dual-hosted git repository.
terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new d66ff0d39b8 Add Checkstyle rule against final test classes (#40035)
d66ff0d39b8 is described below
commit d66ff0d39b878993cc89f322296abff3a4db6004
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Oct 2 11:28:34 2026 +0800
Add Checkstyle rule against final test classes (#40035)
---
src/resources/checkstyle.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/resources/checkstyle.xml b/src/resources/checkstyle.xml
index 97fb1e3bed1..b6abbffa495 100644
--- a/src/resources/checkstyle.xml
+++ b/src/resources/checkstyle.xml
@@ -89,6 +89,10 @@
<!-- Class Design -->
<module name="FinalClass" />
+ <module name="MatchXpath">
+ <property name="query" value="//CLASS_DEF[./IDENT[ends-with(@text, 'Test')]]/MODIFIERS/FINAL" />
+ <message key="matchxpath.match" value="Unit-test classes must not be declared final." />
+ </module>
<!-- cannot recognize for lombok @NoArgsConstructor(access = AccessLevel.PRIVATE), just ignore -->
<!--<module name="HideUtilityClassConstructor" />-->
<module name="InnerTypeLast" />