Skip to content

Commit

Permalink
refactor(spdx-reporter): Use a tool name without spaces
Browse files Browse the repository at this point in the history
While the SPDX spec is not clear about this, the example [1] suggests
that tool names should follow the syntax `toolidentifier-version`, and
some SPDX validation tools actually rely on this [2]. To be on the safe
side, and as "ort" as a (short) tool name is already well known in the
community, follow the example syntax and do not use spaces in the tool /
version string.

[1]: https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#68-creator-field
[2]: interlynk-io/sbombenchmark.dev#11 (comment)

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information
sschuberth committed Aug 23, 2023
1 parent 4ee7714 commit c64c453
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"creationInfo" : {
"comment" : "some creation info comment",
"created" : "<REPLACE_CREATION_DATE_AND_TIME>",
"creators" : [ "Tool: OSS Review Toolkit - <REPLACE_ORT_VERSION>" ],
"creators" : [ "Tool: ort-<REPLACE_ORT_VERSION>" ],
"licenseListVersion" : "<REPLACE_LICENSE_LIST_VERSION>"
},
"name" : "some document name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ creationInfo:
comment: "some creation info comment"
created: "<REPLACE_CREATION_DATE_AND_TIME>"
creators:
- "Tool: OSS Review Toolkit - <REPLACE_ORT_VERSION>"
- "Tool: ort-<REPLACE_ORT_VERSION>"
licenseListVersion: "<REPLACE_LICENSE_LIST_VERSION>"
name: "some document name"
dataLicense: "CC0-1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.ossreviewtoolkit.model.SourceCodeOrigin.VCS
import org.ossreviewtoolkit.model.licenses.LicenseInfoResolver
import org.ossreviewtoolkit.reporter.LicenseTextProvider
import org.ossreviewtoolkit.utils.ort.Environment
import org.ossreviewtoolkit.utils.ort.ORT_FULL_NAME
import org.ossreviewtoolkit.utils.ort.ORT_NAME
import org.ossreviewtoolkit.utils.spdx.SpdxConstants
import org.ossreviewtoolkit.utils.spdx.SpdxLicense
import org.ossreviewtoolkit.utils.spdx.model.SpdxCreationInfo
Expand Down Expand Up @@ -157,7 +157,7 @@ internal object SpdxDocumentModelMapper : Logging {
creationInfo = SpdxCreationInfo(
comment = params.creationInfoComment,
created = Instant.now().truncatedTo(ChronoUnit.SECONDS),
creators = listOf("${SpdxConstants.TOOL} $ORT_FULL_NAME - ${Environment.ORT_VERSION}"),
creators = listOf("${SpdxConstants.TOOL} $ORT_NAME-${Environment.ORT_VERSION}"),
licenseListVersion = SpdxLicense.LICENSE_LIST_VERSION.substringBefore("-")
),
documentNamespace = "spdx://${UUID.randomUUID()}",
Expand Down

0 comments on commit c64c453

Please sign in to comment.