Skip to content

Commit 6437024

Browse files
committed
Add Checkstyle rule ensuring Jupiter Assertions are self-contained
1 parent 64345f1 commit 6437024

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gradle/config/checkstyle/checkstyleMain.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
<property name="message" value="Please use String.formatted() (non-static) rather than String.format() (static)."/>
3535
<property name="ignoreComments" value="true"/>
3636
</module>
37+
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
38+
<!-- see https://github.com/junit-team/junit-framework/issues/4604 -->
39+
<property name="id" value="jupiterAssertions"/>
40+
<property name="maximum" value="0"/>
41+
<property name="format" value="org\.junit\.jupiter\.api\.(Assertions|Assumptions)\."/>
42+
<property name="message" value="Assertions/Assumptions should not be used in production code."/>
43+
<property name="ignoreComments" value="true"/>
44+
</module>
3745
<module name="HideUtilityClassConstructor"/>
3846
<module name="ModifierOrder"/>
3947
<module name="EqualsAvoidNull"/>

0 commit comments

Comments
 (0)