File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,17 @@ This file is divided into 3 sections:
150150 // scalastyle:on println]]> </customMessage >
151151 </check >
152152
153+ <check customId =" classforname" level =" error" class =" org.scalastyle.file.RegexChecker" enabled =" true" >
154+ <parameters ><parameter name =" regex" >Class\.forName</parameter ></parameters >
155+ <customMessage ><![CDATA[
156+ Are you sure that you want to use Class.forName? In nearly all cases, you should use Utils.classForName instead.
157+ If you must use Class.forName, wrap the code block with
158+ // scalastyle:off classforname
159+ Class.forName(...)
160+ // scalastyle:on classforname
161+ ]]> </customMessage >
162+ </check >
163+
153164 <!-- ================================================================================ -->
154165 <!-- rules we'd like to enforce, but haven't cleaned up the codebase yet -->
155166 <!-- ================================================================================ -->
You can’t perform that action at this time.
0 commit comments