This is an automated email from the ASF dual-hosted git repository. yzou pushed a commit to branch yzou-test-shade in repository https://gitbox.apache.org/repos/asf/polaris.git
commit f122578ce799c8e279369384a5f4d681a7ee7b4e Author: Yun Zou <yunzou.colost...@gmail.com> AuthorDate: Fri Jun 20 13:50:33 2025 -0700 add change --- .../src/main/kotlin/polaris-java.gradle.kts | 5 +++ codestyle/checkstyle.xml | 4 ++ codestyle/checkstyle_no_illegalimport.xml | 43 ---------------------- codestyle/checkstyle_suppressions.xml | 32 ++++++++++++++++ plugins/spark/v3.5/spark/build.gradle.kts | 2 +- 5 files changed, 42 insertions(+), 44 deletions(-) diff --git a/build-logic/src/main/kotlin/polaris-java.gradle.kts b/build-logic/src/main/kotlin/polaris-java.gradle.kts index 4370b5518..0d8d7c961 100644 --- a/build-logic/src/main/kotlin/polaris-java.gradle.kts +++ b/build-logic/src/main/kotlin/polaris-java.gradle.kts @@ -47,6 +47,11 @@ checkstyle { .requiredVersion toolVersion = checkstyleVersion configFile = rootProject.file("codestyle/checkstyle.xml") + configProperties = + mapOf( + "checkstyle.suppression.file" to + rootProject.file("codestyle/checkstyle_suppressions.xml").absolutePath + ) isIgnoreFailures = false maxErrors = 0 maxWarnings = 0 diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index d3986dc3e..ac00bfcfb 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -26,6 +26,10 @@ <property name="severity" value="warning"/> <property name="fileExtensions" value="java, properties, xml"/> + <module name="SuppressionFilter"> + <property name="file" value="${checkstyle.suppression.file}"/> + </module> + <!-- Excludes all 'module-info.java' files --> <!-- See https://checkstyle.org/config_filefilters.html --> <module name="BeforeExecutionExclusionFileFilter"> diff --git a/codestyle/checkstyle_no_illegalimport.xml b/codestyle/checkstyle_no_illegalimport.xml deleted file mode 100644 index 5f102b9d7..000000000 --- a/codestyle/checkstyle_no_illegalimport.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE module PUBLIC - "-//Puppy Crawl//DTD Check Configuration 1.3//EN" - "https://checkstyle.org/dtds/configuration_1_3.dtd"> - -<module name="Checker"> - <property name="charset" value="UTF-8"/> - <property name="severity" value="warning"/> - <property name="fileExtensions" value="java, properties, xml"/> - - <!-- Excludes all 'module-info.java' files --> - <!-- See https://checkstyle.org/config_filefilters.html --> - <module name="BeforeExecutionExclusionFileFilter"> - <property name="fileNamePattern" value="module\-info\.java$"/> - </module> - - <!-- https://checkstyle.org/config_filters.html#SuppressionFilter --> - <module name="SuppressionFilter"> - <property name="file" value="${org.checkstyle.google.suppressionfilter.config}" - default="checkstyle-suppressions.xml" /> - <property name="optional" value="true"/> - </module> - - -</module> diff --git a/codestyle/checkstyle_suppressions.xml b/codestyle/checkstyle_suppressions.xml new file mode 100644 index 000000000..1f6f0aad9 --- /dev/null +++ b/codestyle/checkstyle_suppressions.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<!DOCTYPE suppressions PUBLIC + "-//Puppy Crawl//DTD Suppressions Configuration 1.2//EN" + "https://checkstyle.org/dtds/suppressions_1_2.dtd"> + +<suppressions> + <!-- + Suppress IllegalImport in all files under plugins/spark/v3.5/spark. + The spark client relies on the shaded libraries from iceberg-spark-runtime, + and therefore uses imports like org.apache.iceberg.shaded.* in the code, + which is intended. + --> + <suppress checks="IllegalImport" files="plugins/spark/v3.5/spark/.*"/> +</suppressions> diff --git a/plugins/spark/v3.5/spark/build.gradle.kts b/plugins/spark/v3.5/spark/build.gradle.kts index 11cf67f73..77e60198d 100644 --- a/plugins/spark/v3.5/spark/build.gradle.kts +++ b/plugins/spark/v3.5/spark/build.gradle.kts @@ -40,7 +40,7 @@ val scalaLibraryVersion = // the spark client relies on the shaded libraries from iceberg-spark-runtime, and therefore // uses imports like org.apache.iceberg.shaded.*. Use checkstyle_no_illegalimport.xml to allow // the import from shaded libraries for spark client. -checkstyle { configFile = rootProject.file("codestyle/checkstyle_no_illegalimport.xml") } +// checkstyle { configFile = rootProject.file("codestyle/checkstyle_no_illegalimport.xml") } dependencies { // TODO: extract a polaris-rest module as a thin layer for