Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add license header by spotless:apply automatically #110

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dev/copyright/java-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

1 change: 1 addition & 0 deletions dev/copyright/scala-header.txt
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -722,13 +722,19 @@ under the License.
<importOrder>
<order>java|javax,scala,org,org.apache,com,org.apache.comet,\#,\#org.apache.comet</order>
</importOrder>
<licenseHeader>
<file>${maven.multiModuleProjectDirectory}/dev/copyright/java-header.txt</file>
</licenseHeader>
</java>
<scala>
<toggleOffOn />
<scalafmt>
<version>3.6.1</version>
<file>${maven.multiModuleProjectDirectory}/scalafmt.conf</file>
</scalafmt>
<licenseHeader>
<file>${maven.multiModuleProjectDirectory}/dev/copyright/scala-header.txt</file>
</licenseHeader>
</scala>
</configuration>
</plugin>
Expand Down
26 changes: 14 additions & 12 deletions spark/src/main/scala/org/apache/spark/sql/comet/CometPlan.scala
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* 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
* 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
* 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.
* 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.
*/

package org.apache.spark.sql.comet
Expand Down
10 changes: 5 additions & 5 deletions spark/src/test/scala/org/apache/spark/sql/TPCH.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
* under the License.
*/

package org.apache.spark.sql

import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

/**
* Mostly copied from
* https://github.com/databricks/spark-sql-perf/blob/master/src/main/scala/com/databricks/spark/sql/perf/tpch/TPCH.scala
*
* TODO: port this back to the upstream Spark similar to TPCDS benchmark
*/

package org.apache.spark.sql

import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

class Dbgen(dbgenDir: String, params: Seq[String]) extends DataGenerator {
val dbgen: String = s"$dbgenDir/dbgen"

Expand Down
13 changes: 6 additions & 7 deletions spark/src/test/scala/org/apache/spark/sql/Tables.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
* under the License.
*/

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to the class header. Otherwise it would be stripped off by spotless:apply for license header formating

* Mostly copied from
* https://github.com/databricks/spark-sql-perf/blob/master/src/main/scala/com/databricks/spark/sql/perf/Tables.scala
*
* TODO: port this back to the upstream Spark similar to TPCDS benchmark
*/

package org.apache.spark.sql

import scala.util.Try
Expand All @@ -35,6 +28,12 @@ import org.apache.spark.rdd.RDD
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types._

/**
* Mostly copied from
* https://github.com/databricks/spark-sql-perf/blob/master/src/main/scala/com/databricks/spark/sql/perf/Tables.scala
*
* TODO: port this back to the upstream Spark similar to TPCDS benchmark
*/
trait DataGenerator extends Serializable {
def generate(
sparkContext: SparkContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.spark.sql.comet

import java.io.File
Expand Down