Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy committed Jan 10, 2025
1 parent ab3d20f commit 44b8e0f
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion api/iceberg-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}

Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/polaris-java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ 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/",
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions build-logic/src/main/kotlin/polaris-license-report.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/publishing/MemoizedGitInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/publishing/configurePom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fun addMissingMandatoryDependencyVersions(project: Project, projectNode: Node) {
findDependency(
project.configurations.findByName("testRuntimeClasspath"),
depGroup,
depName
depName,
)
}

Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/publishing/rootProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
8 changes: 4 additions & 4 deletions build-logic/src/main/kotlin/publishing/shadowPub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions build-logic/src/main/kotlin/publishing/util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -206,7 +207,7 @@ internal fun fetchProjectPeople(apacheId: String): ProjectPeople {
licenseUrl,
bugDatabase,
inceptionYear,
peopleList
peopleList,
)
}

Expand All @@ -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>)
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public interface PolarisStorageIntegrationProvider {
@SuppressWarnings("unchecked")
<T extends PolarisStorageConfigurationInfo> @Nullable
PolarisStorageIntegration<T> getStorageIntegrationForConfig(
<T extends PolarisStorageConfigurationInfo>
@Nullable PolarisStorageIntegration<T> getStorageIntegrationForConfig(
PolarisStorageConfigurationInfo polarisStorageConfigurationInfo);
}
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ public Response addGrantToCatalogRole(
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 =
Expand Down Expand Up @@ -595,8 +595,8 @@ public Response revokeGrantFromCatalogRole(

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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1735,16 +1735,16 @@ private void renameTableLike(
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public PolarisStorageIntegrationProviderImpl(

@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;
Expand Down

0 comments on commit 44b8e0f

Please sign in to comment.