This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 7d53b73c Bump spotless to v7 (#697)
7d53b73c is described below
commit 7d53b73ca21c93c474c19722356eaac121051fc1
Author: Robert Stupp <[email protected]>
AuthorDate: Sat Jan 11 01:04:25 2025 +0100
Bump spotless to v7 (#697)
* Prepare version bump of spotless
spotless v7 fails on Gradle with some `SerializationException`, moving the
`callable` works around this issue (as [mentioned
here](https://github.com/diffplug/spotless/issues/2387)).
Also removing the unnecessary `buildscript.dependencies` and the implied
2nd spotless version definition.
* main: Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7
* spotlessApply
---------
Co-authored-by: Mend Renovate <[email protected]>
---
api/iceberg-service/build.gradle.kts | 2 +-
.../src/main/kotlin/polaris-java.gradle.kts | 24 ++++++++++++++--------
.../main/kotlin/polaris-license-report.gradle.kts | 6 +++---
.../src/main/kotlin/publishing/MemoizedGitInfo.kt | 2 +-
.../src/main/kotlin/publishing/configurePom.kt | 2 +-
.../src/main/kotlin/publishing/rootProject.kt | 2 +-
.../src/main/kotlin/publishing/shadowPub.kt | 8 ++++----
build-logic/src/main/kotlin/publishing/util.kt | 9 ++++----
build.gradle.kts | 7 +------
gradle/baselibs.versions.toml | 2 +-
gradle/libs.versions.toml | 1 -
.../storage/PolarisStorageIntegrationProvider.java | 4 ++--
.../polaris/service/admin/PolarisServiceImpl.java | 8 ++++----
.../service/catalog/BasePolarisCatalog.java | 6 +++---
.../PolarisStorageIntegrationProviderImpl.java | 4 ++--
15 files changed, 44 insertions(+), 43 deletions(-)
diff --git a/api/iceberg-service/build.gradle.kts
b/api/iceberg-service/build.gradle.kts
index 0b05626e..a0e4768b 100644
--- a/api/iceberg-service/build.gradle.kts
+++ b/api/iceberg-service/build.gradle.kts
@@ -100,7 +100,7 @@ openApiGenerate {
"CommitTableRequest" to
"org.apache.polaris.service.types.CommitTableRequest",
"NotificationRequest" to
"org.apache.polaris.service.types.NotificationRequest",
"TableUpdateNotification" to
"org.apache.polaris.service.types.TableUpdateNotification",
- "NotificationType" to "org.apache.polaris.service.types.NotificationType"
+ "NotificationType" to
"org.apache.polaris.service.types.NotificationType",
)
}
diff --git a/build-logic/src/main/kotlin/polaris-java.gradle.kts
b/build-logic/src/main/kotlin/polaris-java.gradle.kts
index 5226fbdd..7c845a20 100644
--- a/build-logic/src/main/kotlin/polaris-java.gradle.kts
+++ b/build-logic/src/main/kotlin/polaris-java.gradle.kts
@@ -17,6 +17,8 @@
* under the License.
*/
+import com.diffplug.spotless.FormatterFunc
+import java.io.Serializable
import net.ltgt.gradle.errorprone.errorprone
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.testing.Test
@@ -74,25 +76,29 @@ tasks.withType(Jar::class).configureEach {
// manifests for release(-like) builds.
"Implementation-Title" to "Apache Polaris(TM) (incubating)",
"Implementation-Vendor" to "Apache Software Foundation",
- "Implementation-URL" to "https://polaris.apache.org/"
+ "Implementation-URL" to "https://polaris.apache.org/",
)
}
}
spotless {
- val disallowWildcardImports = { text: String ->
- val regex = "~/import .*\\.\\*;/".toRegex()
- if (regex.matches(text)) {
- throw GradleException("Wildcard imports disallowed -
${regex.findAll(text)}")
- }
- text
- }
java {
target("src/main/java/**/*.java", "src/testFixtures/java/**/*.java",
"src/test/java/**/*.java")
googleJavaFormat()
licenseHeaderFile(rootProject.file("codestyle/copyright-header-java.txt"))
endWithNewline()
- custom("disallowWildcardImports", disallowWildcardImports)
+ custom(
+ "disallowWildcardImports",
+ object : Serializable, FormatterFunc {
+ override fun apply(text: String): String {
+ val regex = "~/import .*\\.\\*;/".toRegex()
+ if (regex.matches(text)) {
+ throw GradleException("Wildcard imports disallowed -
${regex.findAll(text)}")
+ }
+ return text
+ }
+ },
+ )
toggleOffOn()
}
kotlinGradle {
diff --git a/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
b/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
index a28ba5eb..ab0a76be 100644
--- a/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
+++ b/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
@@ -31,9 +31,9 @@ afterEvaluate {
arrayOf(
LicenseBundleNormalizer(
"${rootProject.projectDir}/gradle/license/normalizer-bundle.json",
- false
+ false,
),
- LicenseFileValidation()
+ LicenseFileValidation(),
)
allowedLicensesFile =
rootProject.projectDir.resolve("gradle/license/allowed-licenses.json")
renderers =
@@ -48,7 +48,7 @@ val generateLicenseReport =
inputs
.files(
rootProject.projectDir.resolve("gradle/license/normalizer-bundle.json"),
- rootProject.projectDir.resolve("gradle/license/allowed-licenses.json")
+ rootProject.projectDir.resolve("gradle/license/allowed-licenses.json"),
)
.withPathSensitivity(PathSensitivity.RELATIVE)
inputs.property("renderersHash", Arrays.hashCode(licenseReport.renderers))
diff --git a/build-logic/src/main/kotlin/publishing/MemoizedGitInfo.kt
b/build-logic/src/main/kotlin/publishing/MemoizedGitInfo.kt
index 6479bafc..58d93f4c 100644
--- a/build-logic/src/main/kotlin/publishing/MemoizedGitInfo.kt
+++ b/build-logic/src/main/kotlin/publishing/MemoizedGitInfo.kt
@@ -80,7 +80,7 @@ internal class MemoizedGitInfo {
"Apache-Polaris-Build-Git-Describe" to gitDescribe,
"Apache-Polaris-Build-Timestamp" to timestamp,
"Apache-Polaris-Build-System" to system,
- "Apache-Polaris-Build-Java-Version" to javaVersion
+ "Apache-Polaris-Build-Java-Version" to javaVersion,
)
rootProject.extra["gitReleaseInfo"] = info
return info
diff --git a/build-logic/src/main/kotlin/publishing/configurePom.kt
b/build-logic/src/main/kotlin/publishing/configurePom.kt
index f8ef9814..47088b31 100644
--- a/build-logic/src/main/kotlin/publishing/configurePom.kt
+++ b/build-logic/src/main/kotlin/publishing/configurePom.kt
@@ -169,7 +169,7 @@ fun addMissingMandatoryDependencyVersions(project: Project,
projectNode: Node) {
findDependency(
project.configurations.findByName("testRuntimeClasspath"),
depGroup,
- depName
+ depName,
)
}
diff --git a/build-logic/src/main/kotlin/publishing/rootProject.kt
b/build-logic/src/main/kotlin/publishing/rootProject.kt
index 2ef431ef..f8a637f5 100644
--- a/build-logic/src/main/kotlin/publishing/rootProject.kt
+++ b/build-logic/src/main/kotlin/publishing/rootProject.kt
@@ -56,7 +56,7 @@ internal fun configureOnRootProject(project: Project) =
"--prefix=${e.baseName.get()}/",
"--format=tar.gz",
"--output=${e.sourceTarball.get().asFile.relativeTo(projectDir)}",
- "HEAD"
+ "HEAD",
)
workingDir(project.projectDir)
}
diff --git a/build-logic/src/main/kotlin/publishing/shadowPub.kt
b/build-logic/src/main/kotlin/publishing/shadowPub.kt
index 90f007c7..8ad08f00 100644
--- a/build-logic/src/main/kotlin/publishing/shadowPub.kt
+++ b/build-logic/src/main/kotlin/publishing/shadowPub.kt
@@ -42,7 +42,7 @@ import org.gradle.api.publish.maven.MavenPublication
internal fun configureShadowPublishing(
project: Project,
mavenPublication: MavenPublication,
- softwareComponentFactory: SoftwareComponentFactory
+ softwareComponentFactory: SoftwareComponentFactory,
) =
project.run {
fun isPublishable(element: ConfigurationVariant): Boolean {
@@ -64,15 +64,15 @@ internal fun configureShadowPublishing(
attribute(Usage.USAGE_ATTRIBUTE,
project.objects.named(Usage::class.java, Usage.JAVA_API))
attribute(
Category.CATEGORY_ATTRIBUTE,
- project.objects.named(Category::class.java, Category.LIBRARY)
+ project.objects.named(Category::class.java, Category.LIBRARY),
)
attribute(
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
- project.objects.named(LibraryElements::class.java,
LibraryElements.JAR)
+ project.objects.named(LibraryElements::class.java,
LibraryElements.JAR),
)
attribute(
Bundling.BUNDLING_ATTRIBUTE,
- project.objects.named(Bundling::class.java, Bundling.SHADOWED)
+ project.objects.named(Bundling::class.java, Bundling.SHADOWED),
)
}
outgoing.artifact(shadowJar)
diff --git a/build-logic/src/main/kotlin/publishing/util.kt
b/build-logic/src/main/kotlin/publishing/util.kt
index e8c827a9..1d05a90c 100644
--- a/build-logic/src/main/kotlin/publishing/util.kt
+++ b/build-logic/src/main/kotlin/publishing/util.kt
@@ -34,7 +34,7 @@ import org.gradle.api.artifacts.result.DependencyResult
internal fun findDependency(
config: Configuration?,
depGroup: String,
- depName: String
+ depName: String,
): DependencyResult? {
if (config != null) {
val depResult =
@@ -78,7 +78,8 @@ internal fun generateDigest(input: File, output: File,
algorithm: String) {
}
internal fun <T : Any> unsafeCast(o: Any?): T {
- @Suppress("UNCHECKED_CAST") return o as T
+ @Suppress("UNCHECKED_CAST")
+ return o as T
}
internal fun <T : Any> parseJson(url: String): T {
@@ -206,7 +207,7 @@ internal fun fetchProjectPeople(apacheId: String):
ProjectPeople {
licenseUrl,
bugDatabase,
inceptionYear,
- peopleList
+ peopleList,
)
}
@@ -219,7 +220,7 @@ internal class ProjectPeople(
val licenseUrl: String,
val bugDatabase: String,
val inceptionYear: Int,
- val people: List<ProjectMember>
+ val people: List<ProjectMember>,
)
internal class ProjectMember(val apacheId: String, val name: String, val
roles: List<String>)
diff --git a/build.gradle.kts b/build.gradle.kts
index 4ba465e7..a2a44525 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -20,12 +20,7 @@
import java.net.URI
import org.nosphere.apache.rat.RatTask
-buildscript {
- repositories { maven { url = java.net.URI("https://plugins.gradle.org/m2/")
} }
- dependencies {
-
classpath("com.diffplug.spotless:spotless-plugin-gradle:${libs.plugins.spotless.get().version}")
- }
-}
+buildscript { repositories { maven { url =
java.net.URI("https://plugins.gradle.org/m2/") } } }
plugins {
id("idea")
diff --git a/gradle/baselibs.versions.toml b/gradle/baselibs.versions.toml
index 0bebe051..ea0ccab0 100644
--- a/gradle/baselibs.versions.toml
+++ b/gradle/baselibs.versions.toml
@@ -23,4 +23,4 @@ idea-ext = { module =
"gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle
license-report = { module = "com.github.jk1:gradle-license-report", version =
"2.9" }
nexus-publish = { module = "io.github.gradle-nexus:publish-plugin", version =
"2.0.0" }
shadow = { module = "com.gradleup.shadow:shadow-gradle-plugin", version =
"8.3.5" }
-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version
= "6.25.0" }
+spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version
= "7.0.1" }
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 7abce416..7ca364aa 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -80,4 +80,3 @@ threeten-extra = { module = "org.threeten:threeten-extra",
version = "1.8.0" }
[plugins]
openapi-generator = { id = "org.openapi.generator", version = "7.10.0" }
rat = { id = "org.nosphere.apache.rat", version = "0.8.1" }
-spotless = { id = "com.diffplug.spotless", version = "6.25.0" }
diff --git
a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
index 95f558ba..d2284a96 100644
---
a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
+++
b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageIntegrationProvider.java
@@ -26,7 +26,7 @@ import jakarta.annotation.Nullable;
*/
public interface PolarisStorageIntegrationProvider {
@SuppressWarnings("unchecked")
- <T extends PolarisStorageConfigurationInfo> @Nullable
- PolarisStorageIntegration<T> getStorageIntegrationForConfig(
+ <T extends PolarisStorageConfigurationInfo>
+ @Nullable PolarisStorageIntegration<T> getStorageIntegrationForConfig(
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo);
}
diff --git
a/service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java
b/service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java
index 49b7a3bb..72ea099c 100644
---
a/service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java
+++
b/service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java
@@ -519,8 +519,8 @@ public class PolarisServiceImpl
catalogName);
PolarisAdminService adminService = newAdminService(realmContext,
securityContext);
switch (grantRequest.getGrant()) {
- // The per-securable-type Privilege enums must be exact String match
for a subset of all
- // PolarisPrivilege values.
+ // The per-securable-type Privilege enums must be exact String match for
a subset of all
+ // PolarisPrivilege values.
case ViewGrant viewGrant:
{
PolarisPrivilege privilege =
@@ -595,8 +595,8 @@ public class PolarisServiceImpl
PolarisAdminService adminService = newAdminService(realmContext,
securityContext);
switch (grantRequest.getGrant()) {
- // The per-securable-type Privilege enums must be exact String match
for a subset of all
- // PolarisPrivilege values.
+ // The per-securable-type Privilege enums must be exact String match for
a subset of all
+ // PolarisPrivilege values.
case ViewGrant viewGrant:
{
PolarisPrivilege privilege =
diff --git
a/service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
b/service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
index 3f2cd7a4..3958e79e 100644
---
a/service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
+++
b/service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
@@ -1735,16 +1735,16 @@ public class BasePolarisCatalog extends
BaseMetastoreViewCatalog
case BaseResult.ReturnStatus.ENTITY_NOT_FOUND:
throw new NotFoundException("Cannot rename %s to %s. %s does not
exist", from, to, from);
- // this is temporary. Should throw a special error that will be
caught and retried
+ // this is temporary. Should throw a special error that will be caught
and retried
case BaseResult.ReturnStatus.TARGET_ENTITY_CONCURRENTLY_MODIFIED:
case BaseResult.ReturnStatus.ENTITY_CANNOT_BE_RESOLVED:
throw new RuntimeException("concurrent update detected, please
retry");
- // some entities cannot be renamed
+ // some entities cannot be renamed
case BaseResult.ReturnStatus.ENTITY_CANNOT_BE_RENAMED:
throw new BadRequestException("Cannot rename built-in object %s",
leafEntity.getName());
- // some entities cannot be renamed
+ // some entities cannot be renamed
default:
throw new IllegalStateException(
"Unknown error status " +
returnedEntityResult.getReturnStatus());
diff --git
a/service/common/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
b/service/common/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
index 98195c0e..c30ae066 100644
---
a/service/common/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
+++
b/service/common/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java
@@ -54,8 +54,8 @@ public class PolarisStorageIntegrationProviderImpl implements
PolarisStorageInte
@Override
@SuppressWarnings("unchecked")
- public <T extends PolarisStorageConfigurationInfo> @Nullable
- PolarisStorageIntegration<T> getStorageIntegrationForConfig(
+ public <T extends PolarisStorageConfigurationInfo>
+ @Nullable PolarisStorageIntegration<T> getStorageIntegrationForConfig(
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo) {
if (polarisStorageConfigurationInfo == null) {
return null;