This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion-comet.git


The following commit(s) were added to refs/heads/main by this push:
     new 2e3614d  build: Re-enable Scala style checker and spotless  (#21)
2e3614d is described below

commit 2e3614dd9e59f8666e2b5f1b158c00aaf44ed65a
Author: Chao Sun <[email protected]>
AuthorDate: Wed Feb 14 20:02:09 2024 -0800

    build: Re-enable Scala style checker and spotless  (#21)
    
    This PR re-enables Scala style checker and spotless Maven plugin. Now the 
CI should fail when the code style is incorrect.
---
 dev/scalastyle-config.xml                                        | 9 +++++----
 pom.xml                                                          | 2 --
 scalafmt.conf                                                    | 2 +-
 .../scala/org/apache/spark/sql/comet/CometBatchScanExec.scala    | 4 ++--
 spark/src/main/scala/org/apache/spark/sql/comet/operators.scala  | 4 ++--
 .../test/scala/org/apache/comet/parquet/ParquetReadSuite.scala   | 4 ++--
 6 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/dev/scalastyle-config.xml b/dev/scalastyle-config.xml
index 7d01f72..92ba690 100644
--- a/dev/scalastyle-config.xml
+++ b/dev/scalastyle-config.xml
@@ -242,9 +242,9 @@ This file is divided into 3 sections:
       <parameter name="groups">java,scala,org,apache,3rdParty,comet</parameter>
       <parameter name="group.java">javax?\..*</parameter>
       <parameter name="group.scala">scala\..*</parameter>
-      <parameter name="group.org">org\..*</parameter>
-      <parameter name="group.apache">org\.apache\..*</parameter>
-      <parameter name="group.3rdParty">(?!org\.apache\.comet\.).*</parameter>
+      <parameter name="group.org">org\.(?!apache\.comet).*</parameter>
+      <parameter name="group.apache">org\.apache\.(?!comet).*</parameter>
+      <parameter 
name="group.3rdParty">(?!(javax?\.|scala\.|org\.apache\.comet\.)).*</parameter>
       <parameter name="group.comet">org\.apache\.comet\..*</parameter>
     </parameters>
   </check>
@@ -301,7 +301,8 @@ This file is divided into 3 sections:
   </check>
 
   <check level="error" 
class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" 
enabled="true"></check>
-  <check level="error" 
class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" 
enabled="true"></check>
+  <!-- This rule conflicts with spotless, so disabling it for now -->
+  <check level="error" 
class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" 
enabled="false"></check>
 
   <!-- This breaks symbolic method names so we don't turn it on. -->
   <!-- Maybe we should update it to allow basic symbolic names, and then we 
are good to go. -->
diff --git a/pom.xml b/pom.xml
index dd8d0ce..e693033 100644
--- a/pom.xml
+++ b/pom.xml
@@ -740,7 +740,6 @@ under the License.
       </plugins>
     </pluginManagement>
     <plugins>
-      <!--
       <plugin>
         <groupId>org.scalastyle</groupId>
         <artifactId>scalastyle-maven-plugin</artifactId>
@@ -778,7 +777,6 @@ under the License.
           </execution>
         </executions>
       </plugin>
-      -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
diff --git a/scalafmt.conf b/scalafmt.conf
index 7c8c2b3..ac27e9e 100644
--- a/scalafmt.conf
+++ b/scalafmt.conf
@@ -36,6 +36,6 @@ rewrite.imports.groups = [
   ["scala\\..*"],
   ["org\\..*"],
   ["org\\.apache\\..*"],
-  ["org\\.apache\\.comet\\..*"],
   ["com\\..*"],
+  ["org\\.apache\\.comet\\..*"],
 ]
diff --git 
a/spark/src/main/scala/org/apache/spark/sql/comet/CometBatchScanExec.scala 
b/spark/src/main/scala/org/apache/spark/sql/comet/CometBatchScanExec.scala
index 866231d..d6c3c87 100644
--- a/spark/src/main/scala/org/apache/spark/sql/comet/CometBatchScanExec.scala
+++ b/spark/src/main/scala/org/apache/spark/sql/comet/CometBatchScanExec.scala
@@ -32,11 +32,11 @@ import org.apache.spark.sql.execution.datasources.v2._
 import org.apache.spark.sql.execution.metric._
 import org.apache.spark.sql.vectorized._
 
+import com.google.common.base.Objects
+
 import org.apache.comet.MetricsSupport
 import org.apache.comet.shims.ShimCometBatchScanExec
 
-import com.google.common.base.Objects
-
 case class CometBatchScanExec(wrapped: BatchScanExec, runtimeFilters: 
Seq[Expression])
     extends DataSourceV2ScanExecBase
     with ShimCometBatchScanExec
diff --git a/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala 
b/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala
index 46fc274..eac013e 100644
--- a/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala
+++ b/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala
@@ -33,12 +33,12 @@ import org.apache.spark.sql.execution.{ColumnarToRowExec, 
ExecSubqueryExpression
 import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics}
 import org.apache.spark.sql.vectorized.ColumnarBatch
 
+import com.google.common.base.Objects
+
 import org.apache.comet.{CometConf, CometExecIterator, CometRuntimeException, 
CometSparkSessionExtensions}
 import org.apache.comet.CometConf.{COMET_BATCH_SIZE, COMET_DEBUG_ENABLED, 
COMET_EXEC_MEMORY_FRACTION}
 import org.apache.comet.serde.OperatorOuterClass.Operator
 
-import com.google.common.base.Objects
-
 /**
  * A Comet physical operator
  */
diff --git 
a/spark/src/test/scala/org/apache/comet/parquet/ParquetReadSuite.scala 
b/spark/src/test/scala/org/apache/comet/parquet/ParquetReadSuite.scala
index 4f92242..1cff74d 100644
--- a/spark/src/test/scala/org/apache/comet/parquet/ParquetReadSuite.scala
+++ b/spark/src/test/scala/org/apache/comet/parquet/ParquetReadSuite.scala
@@ -47,11 +47,11 @@ import org.apache.spark.sql.internal.SQLConf
 import org.apache.spark.sql.types._
 import org.apache.spark.unsafe.types.UTF8String
 
+import com.google.common.primitives.UnsignedLong
+
 import org.apache.comet.CometConf
 import org.apache.comet.CometSparkSessionExtensions.isSpark34Plus
 
-import com.google.common.primitives.UnsignedLong
-
 abstract class ParquetReadSuite extends CometTestBase {
   import testImplicits._
 

Reply via email to