Skip to content

Commit

Permalink
chore: Align on "purl" spelling for Package URLs
Browse files Browse the repository at this point in the history
That seems to be the official spelling, see [1].

[1]: https://github.com/package-url/purl-spec?tab=readme-ov-file#solution

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Oct 24, 2024
1 parent d2dd061 commit 4814301
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clients/dos/src/main/kotlin/DosClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DosClient(private val service: DosService) {
return if (response.isSuccessful && responseBody != null) {
responseBody
} else {
logger.error { "Error getting the package configuration for PURL $purl: ${response.errorBody()?.string()}" }
logger.error { "Error getting the package configuration for purl $purl: ${response.errorBody()?.string()}" }

null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ interface VulnerableCodeService {
*/
@Serializable
data class PackageVulnerabilities(
/** The PURL identifying this package. */
/** The purl identifying this package. */
val purl: String,

/** An optional list with vulnerabilities that have not yet been resolved. */
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/utils/PurlExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fun Provenance.toPurlExtras(): PurlExtras =
}

/**
* Decode [Provenance] from extra qualifying data / a subpath of the PURL represented by this [String]. Return
* Decode [Provenance] from extra qualifying data / a subpath of the purl represented by this [String]. Return
* [UnknownProvenance] if extra data is not present.
*/
fun String.toProvenance(): Provenance {
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/utils/PurlUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ enum class PurlType(private val value: String) {
}

/**
* Extra data than can be appended to a "clean" PURL via qualifiers or a subpath.
* Extra data than can be appended to a "clean" purl via qualifiers or a subpath.
*/
data class PurlExtras(
/**
Expand Down
2 changes: 1 addition & 1 deletion model/src/test/kotlin/IdentifierTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class IdentifierTest : WordSpec({
}
}

"Purl representations" should {
"purl representations" should {
"not suffix the scheme with '//'" {
val purl = Identifier("type", "namespace", "name", "version").toPurl()

Expand Down
2 changes: 1 addition & 1 deletion model/src/test/kotlin/utils/PurlExtensionsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PurlExtensionsTest : WordSpec({
purl.toProvenance() shouldBe provenance
}

"work for a PURL without qualifiers" {
"work for a purl without qualifiers" {
"pkg:npm/mime-db@1.33.0".toProvenance() shouldBe UnknownProvenance
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class UploadResultToSw360Command : OrtCommand(
val sw360Project = SW360Project()
.setName(project.id.name)
.setVersion(project.id.version)
.setDescription("A ${project.id.type} project with the PURL ${project.id.toPurl()}.")
.setDescription("A ${project.id.type} project with the purl ${project.id.toPurl()}.")
.setVisibility(SW360Visibility.BUISNESSUNIT_AND_MODERATORS)

return try {
Expand Down
2 changes: 1 addition & 1 deletion plugins/scanners/fossid/src/main/kotlin/FossId.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class FossId internal constructor(
private val GIT_FETCH_DONE_REGEX = Regex("-> FETCH_HEAD(?: Already up to date.)*$")

/**
* A regular expression to extract the artifact and version from a Purl returned by FossID.
* A regular expression to extract the artifact and version from a purl returned by FossID.
*/
@JvmStatic
private val SNIPPET_PURL_REGEX = Regex("^.*/(?<artifact>[^@]+)@(?<version>.+)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ private fun urlToPackageType(url: String): PurlType =
else -> {
PurlType.GENERIC.also {
logger.warn {
"Cannot determine PURL type for URL $url and provider '$provider'. Falling back to '$it'."
"Cannot determine purl type for URL $url and provider '$provider'. Falling back to '$it'."
}
}
}
Expand Down

0 comments on commit 4814301

Please sign in to comment.