Skip to content

Commit 81fc01c

Browse files
authored
Add missing RAT task in benchmarks (#29)
This commit also includes a Spotless configuration so that missing headers are automatically added.
1 parent 6652601 commit 81fc01c

26 files changed

+102
-23
lines changed

benchmarks/build.gradle.kts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import org.nosphere.apache.rat.RatTask
21+
122
plugins {
223
scala
324
id("io.gatling.gradle") version "3.13.5.2"
425
id("com.diffplug.spotless") version "7.0.2"
26+
id("org.nosphere.apache.rat") version "0.8.1"
527
}
628

729
description = "Polaris Iceberg REST API performance tests"
@@ -25,5 +47,48 @@ spotless {
2547
scala {
2648
// Use scalafmt for Scala formatting
2749
scalafmt("3.9.3").configFile(".scalafmt.conf")
50+
// Add license header to Scala files
51+
licenseHeaderFile(rootProject.file("codestyle/copyright-header-scala.txt"), "package ")
2852
}
2953
}
54+
55+
tasks.named<RatTask>("rat").configure {
56+
// Gradle
57+
excludes.add("**/build/**")
58+
excludes.add("gradle/wrapper/gradle-wrapper*")
59+
excludes.add(".gradle")
60+
61+
excludes.add("LICENSE")
62+
excludes.add("DISCLAIMER")
63+
excludes.add("NOTICE")
64+
65+
// Git & GitHub
66+
excludes.add(".git")
67+
excludes.add(".github/pull_request_template.md")
68+
69+
// Misc build artifacts
70+
excludes.add("**/.keep")
71+
excludes.add("logs/**")
72+
excludes.add("**/*.lock")
73+
74+
// Configuration files that cannot have headers
75+
excludes.add("**/*.conf") // Gatling and HOCON config files
76+
excludes.add("**/*.properties") // Gradle wrapper properties
77+
78+
// Binary files
79+
excludes.add("**/*.jar")
80+
excludes.add("**/*.zip")
81+
excludes.add("**/*.tar.gz")
82+
excludes.add("**/*.tgz")
83+
excludes.add("**/*.class")
84+
85+
// IntelliJ
86+
excludes.add(".idea")
87+
excludes.add("**/*.iml")
88+
excludes.add("**/*.iws")
89+
90+
// Rat can't scan binary images
91+
excludes.add("**/*.png")
92+
excludes.add("**/*.svg")
93+
excludes.add("**/*.puml")
94+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/

benchmarks/settings.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
rootProject.name = "Apache Polaris Benchmarks"

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/NAryTreeBuilder.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks
2120

2221
/**

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/RetryOnHttpCodes.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks
2120

2221
import io.gatling.core.Predef._

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/AuthenticationActions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks.actions
2120

2221
import io.gatling.core.Predef._

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/CatalogActions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks.actions
2120

2221
import io.gatling.core.Predef._

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/EntityProperties.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks.actions
2120

2221
import play.api.libs.json.Json

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/NamespaceActions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks.actions
2120

2221
import io.gatling.core.Predef._

benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/actions/TableActions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
2019
package org.apache.polaris.benchmarks.actions
2120

2221
import io.gatling.core.Predef._

0 commit comments

Comments
 (0)