Skip to content

Commit

Permalink
refactor(plugins-api): Rename OrtPlugin.name to displayName
Browse files Browse the repository at this point in the history
Align the name of the annotation property with the property of
`PluginDescriptor` which it is used for.

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.com>
  • Loading branch information
mnonnenmacher committed Sep 9, 2024
1 parent f54636e commit 6c653f1
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins/advisors/nexus-iq/src/main/kotlin/NexusIq.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private val READ_TIMEOUT = Duration.ofSeconds(60)
* If not both `username` and `password` are provided, authentication is disabled.
*/
@OrtPlugin(
name = "Nexus IQ",
displayName = "Nexus IQ",
description = "An advisor that uses Sonatype's Nexus IQ Server to determine vulnerabilities in dependencies.",
factory = AdviceProviderFactory::class
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/advisors/oss-index/src/main/kotlin/OssIndex.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private const val BULK_REQUEST_SIZE = 128
* A wrapper for Sonatype's [OSS Index](https://ossindex.sonatype.org/) security vulnerability data.
*/
@OrtPlugin(
name = "OSS Index",
displayName = "OSS Index",
description = "An advisor that uses Sonatype's OSS Index to determine vulnerabilities in dependencies.",
factory = AdviceProviderFactory::class
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/advisors/osv/src/main/kotlin/Osv.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import us.springett.cvss.Cvss
* OSV.dev API.
*/
@OrtPlugin(
name = "OSV",
displayName = "OSV",
description = "An advisor that retrieves vulnerability information from the Open Source Vulnerabilities database.",
factory = AdviceProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private const val BULK_REQUEST_SIZE = 100
* * **`apiKey`:** The optional API key to use.
*/
@OrtPlugin(
name = "VulnerableCode",
displayName = "VulnerableCode",
description = "An advisor that uses a VulnerableCode instance to determine vulnerabilities in dependencies.",
factory = AdviceProviderFactory::class
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/api/src/main/kotlin/OrtPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlin.reflect.KClass
*/
@Target(AnnotationTarget.CLASS)
annotation class OrtPlugin(
val name: String,
val displayName: String,
val description: String,
val factory: KClass<*>
)
2 changes: 1 addition & 1 deletion plugins/compiler/src/main/kotlin/PluginSpecFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PluginSpecFactory {
containingFile = pluginClass.containingFile,
descriptor = PluginDescriptor(
id = pluginClass.simpleName.asString().removeSuffix(pluginParentClass.simpleName.asString()),
displayName = ortPlugin.name,
displayName = ortPlugin.displayName,
description = ortPlugin.description,
options = pluginOptions
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data class DirPackageConfigurationProviderConfig(
)

@OrtPlugin(
name = "Default Dir Package Configuration Provider",
displayName = "Default Dir Package Configuration Provider",
description = "A package configuration provider that loads package curations from the default directory.",
factory = PackageConfigurationProviderFactory::class
)
Expand All @@ -66,7 +66,7 @@ class DefaultDirPackageConfigurationProvider(descriptor: PluginDescriptor) : Dir
* Supports all file formats specified in [FileFormat].
*/
@OrtPlugin(
name = "Dir Package Configuration Provider",
displayName = "Dir Package Configuration Provider",
description = "Provides package configurations from a directory.",
factory = PackageConfigurationProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ data class DosPackageConfigurationProviderConfig(
* A [PackageConfigurationProvider] that loads [PackageConfiguration]s from a Double Open Server instance.
*/
@OrtPlugin(
name = "Double Open Server Package Configuration Provider",
displayName = "Double Open Server Package Configuration Provider",
description = "A package configuration provider that loads package configurations from a Double Open Server " +
"instance.",
factory = PackageConfigurationProviderFactory::class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private const val PACKAGE_CONFIGURATIONS_DIR = "package-configurations"
* [ort-config repository](https://github.com/oss-review-toolkit/ort-config).
*/
@OrtPlugin(
name = "ort-config",
displayName = "ort-config",
description = "A package configuration provider that loads package configurations from the ort-config repository.",
factory = PackageConfigurationProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ data class ClearlyDefinedPackageCurationProviderConfig(
* A provider for curated package metadata from the [ClearlyDefined](https://clearlydefined.io/) service.
*/
@OrtPlugin(
name = "ClearlyDefined",
displayName = "ClearlyDefined",
description = "Provides package curation data from the ClearlyDefined service.",
factory = PackageCurationProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data class FilePackageCurationProviderConfig(
)

@OrtPlugin(
name = "Default File Package Curation Provider",
displayName = "Default File Package Curation Provider",
description = "A package curation provider that loads package curations from the default file.",
factory = PackageCurationProviderFactory::class
)
Expand All @@ -63,7 +63,7 @@ class DefaultFilePackageCurationProvider(descriptor: PluginDescriptor) : FilePac
)

@OrtPlugin(
name = "Default Dir Package Curation Provider",
displayName = "Default Dir Package Curation Provider",
description = "A package curation provider that loads package curations from the default directory.",
factory = PackageCurationProviderFactory::class
)
Expand All @@ -80,7 +80,7 @@ class DefaultDirPackageCurationProvider(descriptor: PluginDescriptor) : FilePack
* specified in [FileFormat].
*/
@OrtPlugin(
name = "File Package Curation Provider",
displayName = "File Package Curation Provider",
description = "A package curation provider that loads package curations from files.",
factory = PackageCurationProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private const val ORT_CONFIG_REPOSITORY_URL = "https://github.com/oss-review-too
* [ort-config repository](https://github.com/oss-review-toolkit/ort-config).
*/
@OrtPlugin(
name = "ort-config",
displayName = "ort-config",
description = "A package curation provider that loads package curations from the ort-config repository.",
factory = PackageCurationProviderFactory::class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ data class Sw360PackageCurationProviderConfig(
* A [PackageCurationProvider] for curated package metadata from the configured SW360 instance using the REST API.
*/
@OrtPlugin(
name = "SW360 Package Curation Provider",
displayName = "SW360 Package Curation Provider",
description = "Provides package metadata from the configured SW360 instance using the REST API.",
factory = PackageCurationProviderFactory::class
)
Expand Down

0 comments on commit 6c653f1

Please sign in to comment.