Skip to content

Commit 95a9689

Browse files
committed
[SPARK-53140][TESTS] Ban org.apache.commons.io.FileUtils
### What changes were proposed in this pull request? This PR aims to ban `org.apache.commons.io.FileUtils` usage in favor of `Java`'s and `Spark`'s built-in methods. ### Why are the changes needed? Apache Spark already migrated to `Java` or `Spark`'s built-in methods. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51869 from dongjoon-hyun/SPARK-53140. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 2f1fde5 commit 95a9689

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dev/checkstyle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
<property name="illegalPkgs" value="org.apache.log4j" />
185185
<property name="illegalPkgs" value="org.apache.commons.lang" />
186186
<property name="illegalPkgs" value="org.apache.commons.lang3.tuple" />
187+
<property name="illegalClasses" value="org.apache.commons.io.FileUtils" />
187188
<property name="illegalClasses" value="org.apache.commons.lang3.JavaVersion" />
188189
<property name="illegalClasses" value="org.apache.commons.lang3.Strings" />
189190
<property name="illegalClasses" value="org.apache.commons.lang3.StringUtils" />

scalastyle-config.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ This file is divided into 3 sections:
454454
<customMessage>Use Utils.strip method instead</customMessage>
455455
</check>
456456

457+
<check customId="commonsiofileutils" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
458+
<parameters><parameter name="regex">org\.apache\.commons\.io\.FileUtils\b</parameter></parameters>
459+
<customMessage>Use Java API or Spark's JavaUtils/SparkSystemUtils/Utils instead</customMessage>
460+
</check>
461+
457462
<check customId="commonslang3stringutils" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
458463
<parameters><parameter name="regex">org\.apache\.commons\.lang3\.StringUtils\b</parameter></parameters>
459464
<customMessage>Use Java String or Spark's Utils/JavaUtils methods instead</customMessage>

0 commit comments

Comments
 (0)