This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new f2510072c217 [SPARK-53211][TESTS] Ban `com.google.common.io.Files` f2510072c217 is described below commit f2510072c2173811c976a97ddf9f3f1bddc03323 Author: Dongjoon Hyun <dongj...@apache.org> AuthorDate: Sat Aug 9 07:12:46 2025 -0700 [SPARK-53211][TESTS] Ban `com.google.common.io.Files` ### What changes were proposed in this pull request? This PR aims to ban `com.google.common.io.Files`. ### Why are the changes needed? Since Apache Spark already migrated to Java's native API or Spark's better implementation, we had better prevent future regressions explicitly. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51936 from dongjoon-hyun/SPARK-53211. Authored-by: Dongjoon Hyun <dongj...@apache.org> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> --- dev/checkstyle.xml | 1 + scalastyle-config.xml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dev/checkstyle.xml b/dev/checkstyle.xml index 1dd24bdc3047..a5d1015ea49d 100644 --- a/dev/checkstyle.xml +++ b/dev/checkstyle.xml @@ -192,6 +192,7 @@ <property name="illegalClasses" value="org.apache.hadoop.io.IOUtils" /> <property name="illegalClasses" value="com.google.common.base.Strings" /> <property name="illegalClasses" value="com.google.common.io.BaseEncoding" /> + <property name="illegalClasses" value="com.google.common.io.Files" /> </module> <module name="RegexpSinglelineJava"> <property name="format" value="Charset\.defaultCharset"/> diff --git a/scalastyle-config.xml b/scalastyle-config.xml index b46d996c89c8..a4ffb42400a3 100644 --- a/scalastyle-config.xml +++ b/scalastyle-config.xml @@ -782,7 +782,12 @@ This file is divided into 3 sections: <customMessage>Use org.apache.spark.util.collection.Utils instead.</customMessage> </check> - <check customId="maputils" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> + <check customId="googleFiles" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> + <parameters><parameter name="regex">com\.google\.common\.io\.Files\b</parameter></parameters> + <customMessage>Use Java API or Spark's JavaUtils/SparkFileUtils/Utils instead.</customMessage> + </check> + + <check customId="googleBaseEncoding" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> <parameters><parameter name="regex">com\.google\.common\.io\.BaseEncoding\b</parameter></parameters> <customMessage>Use Java APIs (like java.util.Base64) instead.</customMessage> </check> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org