From f1bc44b5cbc67c40c64c9194bdd57e7509299df4 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Mon, 1 Jul 2024 12:31:00 +0200 Subject: [PATCH] refactor(bazel): Align on the "to" prefix for several functions Consistently use the "to" prefix for functions which convert from Bazel's to ORT's model. Signed-off-by: Frank Viernau --- plugins/package-managers/bazel/src/main/kotlin/Bazel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt b/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt index 113a881139608..b50929bd5e62d 100644 --- a/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt +++ b/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt @@ -143,8 +143,8 @@ class Bazel( description = "", homepageUrl = metadata?.homepage?.toString().orEmpty(), binaryArtifact = RemoteArtifact.EMPTY, - sourceArtifact = sourceInfo?.remoteArtifact().orEmpty(), - vcs = metadata?.vcsInfo().orEmpty() + sourceArtifact = sourceInfo?.toRemoteArtifact().orEmpty(), + vcs = metadata?.toVcsInfo().orEmpty() ) private fun getModuleMetadata(id: Identifier, registry: BazelModuleRegistryService): ModuleMetadata? = @@ -206,7 +206,7 @@ private fun String.expandRepositoryUrl(): String = this } -private fun ModuleMetadata.vcsInfo() = +private fun ModuleMetadata.toVcsInfo() = VcsInfo( type = VcsType.GIT, url = repository?.firstOrNull().orEmpty().expandRepositoryUrl(), @@ -214,7 +214,7 @@ private fun ModuleMetadata.vcsInfo() = path = "" ) -private fun ModuleSourceInfo.remoteArtifact(): RemoteArtifact { +private fun ModuleSourceInfo.toRemoteArtifact(): RemoteArtifact { val (algo, b64digest) = integrity.split("-", limit = 2) val digest = Base64.getDecoder().decode(b64digest).encodeHex()