From 909231b2a49f3f3d1a11461bdedc03ee4994307a Mon Sep 17 00:00:00 2001 From: Martin Nonnenmacher Date: Fri, 24 Jun 2022 18:23:56 +0200 Subject: [PATCH] Several grammatical and spelling corrections throughout the code base Signed-off-by: Martin Nonnenmacher --- README.md | 14 +++++++------- .../assets/projects/synthetic/spdx/libs/README.md | 2 +- .../src/funTest/kotlin/managers/MavenFunTest.kt | 2 +- analyzer/src/main/kotlin/PackageManager.kt | 2 +- analyzer/src/main/kotlin/managers/Bower.kt | 2 +- analyzer/src/main/kotlin/managers/Cargo.kt | 4 ++-- analyzer/src/main/kotlin/managers/Carthage.kt | 4 ++-- analyzer/src/main/kotlin/managers/Composer.kt | 4 ++-- analyzer/src/main/kotlin/managers/Npm.kt | 2 +- analyzer/src/main/kotlin/managers/Pip.kt | 6 +++--- analyzer/src/main/kotlin/managers/Pub.kt | 2 +- .../src/main/kotlin/managers/utils/MavenSupport.kt | 2 +- .../kotlin/commands/UploadResultToSw360Command.kt | 9 ++++----- clients/README.md | 2 +- .../src/main/kotlin/ClearlyDefinedService.kt | 2 +- clients/scanoss/src/main/kotlin/model/Model.kt | 2 +- detekt-rules/src/main/kotlin/OrtImportOrder.kt | 2 +- downloader/src/main/kotlin/Downloader.kt | 6 +++--- downloader/src/main/kotlin/VcsHost.kt | 2 +- downloader/src/main/kotlin/VersionControlSystem.kt | 2 +- downloader/src/main/kotlin/vcs/Subversion.kt | 2 +- evaluator/src/main/kotlin/RuleMatcher.kt | 2 +- integrations/tekton/README.md | 4 ++-- .../kotlin/CompatibilityDependencyNavigator.kt | 8 ++++---- model/src/main/kotlin/DependencyGraph.kt | 2 +- model/src/main/kotlin/DependencyNavigator.kt | 8 ++++---- model/src/main/kotlin/OrtResult.kt | 2 +- model/src/main/kotlin/PackageLinkage.kt | 6 +++--- .../kotlin/config/RuleViolationResolutionReason.kt | 2 +- .../main/kotlin/config/ScanStorageConfiguration.kt | 2 +- .../main/kotlin/licenses/LicenseClassifications.kt | 2 +- model/src/main/kotlin/utils/RootLicenseMatcher.kt | 2 +- reporter/build.gradle.kts | 2 +- reporter/src/main/kotlin/Reporter.kt | 2 +- .../src/main/kotlin/reporters/CycloneDxReporter.kt | 4 ++-- .../reporters/evaluatedmodel/EvaluatedModel.kt | 4 ++-- .../main/kotlin/reporters/fossid/FossIdReporter.kt | 2 +- .../reporters/freemarker/NoticeTemplateReporter.kt | 2 +- .../kotlin/reporters/spdx/SpdxDocumentReporter.kt | 2 +- .../kotlin/scanners/AbstractScannerFunTest.kt | 2 +- scanner/src/main/kotlin/scanners/fossid/FossId.kt | 2 +- .../kotlin/scanners/fossid/FossIdNamingProvider.kt | 2 +- .../src/main/kotlin/storages/CompositeStorage.kt | 2 +- .../src/main/kotlin/storages/utils/JsonbSupport.kt | 2 +- .../kotlin/experimental/ExperimentalScannerTest.kt | 6 +++--- .../kotlin/storages/ClearlyDefinedStorageTest.kt | 2 +- utils/common/src/main/kotlin/Extensions.kt | 6 +++--- utils/ort/src/main/kotlin/OkHttpClientHelper.kt | 2 +- utils/ort/src/main/kotlin/OrtProxySelector.kt | 2 +- utils/ort/src/main/kotlin/Utils.kt | 8 ++++---- utils/spdx/src/main/kotlin/SpdxExpression.kt | 2 +- utils/spdx/src/main/kotlin/Utils.kt | 2 +- utils/spdx/src/main/kotlin/model/SpdxFile.kt | 4 ++-- 53 files changed, 88 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 7251ad1638057..e4e5aa494638c 100644 --- a/README.md +++ b/README.md @@ -126,8 +126,8 @@ You can find further hints for using ORT with Docker in the [documentation](./do ## Run natively -First of all, make sure that the locale of your system is set to `en_US.UTF-8` as using other locales might lead to -issues with parsing the output of some external tools. +First, make sure that the locale of your system is set to `en_US.UTF-8` as using other locales might lead to issues with +parsing the output of some external tools. Then install any missing external command line tools as listed by @@ -192,15 +192,15 @@ operational. | HOCON | Global | `$ORT_CONFIG_DIR/ort.conf` | The [reference configuration file](./model/src/main/resources/reference.conf) gives a good impression about the content -of the main ORT configuration file. It consists of sections related to different sub components of ORT. The meaning -of these sections and the properties they can contain is described together with the corresponding sub components. +of the main ORT configuration file. It consists of sections related to different subcomponents of ORT. The meaning +of these sections and the properties they can contain is described together with the corresponding subcomponents. While the file is rather static, there are means to override configuration options for a specific run of ORT or to customize the configuration to a specific environment. The following options are supported, in order of precedence: * Properties can be defined via environment variables by using the full property path as the variable name. For instance, one can override the Postgres schema by setting - `ort.scanner.storages.postgres.schema=test_schema`. The variable's name is case sensitive. + `ort.scanner.storages.postgres.schema=test_schema`. The variable's name is case-sensitive. Some programs like Bash do not support dots in variable names. For this case, the dots can be replaced by double underscores, i.e., the above example is turned into `ort__scanner__storages__postgres__schema=test_schema`. @@ -248,7 +248,7 @@ A directory that contains license texts which are not provided by ORT. #### [How to fix text provider script](./docs/how-to-fix-text-provider-kts.md) -A Kotlin script that enables the injection of how-to-fix texts in markdown format for ORT issues into the reports. +A Kotlin script that enables the injection of how-to-fix texts in Markdown format for ORT issues into the reports. | Format | Scope | Default location | |---------------|--------|------------------------------------------------| @@ -688,7 +688,7 @@ following formats are supported (reporter names are case-insensitive): ORT is being continuously used on Linux, Windows and macOS by the [core development team](https://github.com/orgs/oss-review-toolkit/people), so these operating systems are -considered to be well supported. +considered to be well-supported. To run the ORT binaries (also see [Installation from binaries](#from-binaries)) at least Java 11 is required. Memory and CPU requirements vary depending on the size and type of project(s) to analyze / scan, but the general recommendation is diff --git a/analyzer/src/funTest/assets/projects/synthetic/spdx/libs/README.md b/analyzer/src/funTest/assets/projects/synthetic/spdx/libs/README.md index eeda78a10e224..7365aa547048a 100644 --- a/analyzer/src/funTest/assets/projects/synthetic/spdx/libs/README.md +++ b/analyzer/src/funTest/assets/projects/synthetic/spdx/libs/README.md @@ -1 +1 @@ -The sub-directories are pretended to contain the source code of the package the directory is named after. +The subdirectories are pretended to contain the source code of the package the directory is named after. diff --git a/analyzer/src/funTest/kotlin/managers/MavenFunTest.kt b/analyzer/src/funTest/kotlin/managers/MavenFunTest.kt index e110c623365a7..31aeafbbd2500 100644 --- a/analyzer/src/funTest/kotlin/managers/MavenFunTest.kt +++ b/analyzer/src/funTest/kotlin/managers/MavenFunTest.kt @@ -67,7 +67,7 @@ class MavenFunTest : StringSpec() { ) // app depends on lib, so we also have to pass the pom.xml of lib to resolveDependencies so that it is - // available in the Maven.projectsByIdentifier cache. Otherwise resolution of transitive dependencies would + // available in the Maven.projectsByIdentifier cache. Otherwise, resolution of transitive dependencies would // not work. val managerResult = createMaven().resolveDependencies(listOf(pomFileApp, pomFileLib), emptyMap()) val result = managerResult.projectResults[pomFileApp] diff --git a/analyzer/src/main/kotlin/PackageManager.kt b/analyzer/src/main/kotlin/PackageManager.kt index 50f743f3fa81c..730bdbbde0d7a 100644 --- a/analyzer/src/main/kotlin/PackageManager.kt +++ b/analyzer/src/main/kotlin/PackageManager.kt @@ -218,7 +218,7 @@ abstract class PackageManager( /** * Generate the final result to be returned by this package manager. This function is called at the very end of the * execution of this package manager (after [afterResolution]) with the [projectResults] created for the single - * definition files that have been processed. It can be overridden by sub classes to add additional data to the + * definition files that have been processed. It can be overridden by subclasses to add additional data to the * result. This base implementation produces a result that contains only the passed in map with project results. */ protected open fun createPackageManagerResult(projectResults: Map>): diff --git a/analyzer/src/main/kotlin/managers/Bower.kt b/analyzer/src/main/kotlin/managers/Bower.kt index d239d9593caa4..12bafa2cc944f 100644 --- a/analyzer/src/main/kotlin/managers/Bower.kt +++ b/analyzer/src/main/kotlin/managers/Bower.kt @@ -154,7 +154,7 @@ class Bower( private fun dependencyKeyOf(node: JsonNode): String? { // As non-null dependency keys are supposed to define an equivalence relation for parsing 'missing' nodes, - // only the name and version attributes can be used. Typically those attributes should be not null + // only the name and version attributes can be used. Typically, those attributes should be not null // however in particular for root projects the null case also happens. val name = node["pkgMeta"]["name"].textValueOrEmpty() val version = node["pkgMeta"]["version"].textValueOrEmpty() diff --git a/analyzer/src/main/kotlin/managers/Cargo.kt b/analyzer/src/main/kotlin/managers/Cargo.kt index 61673224ae9f0..fddcbc8857f50 100644 --- a/analyzer/src/main/kotlin/managers/Cargo.kt +++ b/analyzer/src/main/kotlin/managers/Cargo.kt @@ -118,7 +118,7 @@ class Cargo( } /** - * Check if a package is a project. All path dependencies inside of the analyzer root are treated as project + * Check if a package is a project. All path dependencies inside the analyzer root are treated as project * dependencies. */ private fun isProjectDependency(id: String) = @@ -247,7 +247,7 @@ private fun parseDeclaredLicenses(node: JsonNode): SortedSet { .map { it.trim() } .filterTo(sortedSetOf()) { it.isNotEmpty() } - // Cargo allows to declare non-SPDX licenses only by referencing a license file. If a license file is specified, add + // Cargo allows declaring non-SPDX licenses only by referencing a license file. If a license file is specified, add // an unknown declared license to indicate that there is a declared license, but we cannot know which it is at this // point. // See: https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields diff --git a/analyzer/src/main/kotlin/managers/Carthage.kt b/analyzer/src/main/kotlin/managers/Carthage.kt index 809fe111c6626..64b2739b5b376 100644 --- a/analyzer/src/main/kotlin/managers/Carthage.kt +++ b/analyzer/src/main/kotlin/managers/Carthage.kt @@ -136,7 +136,7 @@ class Carthage( return when (type) { DependencyType.GITHUB -> { - // ID consists of github username/project or a github enterprise URL. + // ID consists of GitHub username/project or a GitHub enterprise URL. val projectUrl = if (id.split('/').size == 2) { val (username, project) = id.split("/", limit = 2) "https://github.com/$username/$project" @@ -159,7 +159,7 @@ class Carthage( } DependencyType.BINARY -> { - // ID is an URL or a path to a file that contains a Carthage binary project specification. + // ID is a URL or a path to a file that contains a Carthage binary project specification. val binarySpecString = if (isFilePath(workingDir, id)) { val filePath = id.removePrefix("file://") val binarySpecFile = when { diff --git a/analyzer/src/main/kotlin/managers/Composer.kt b/analyzer/src/main/kotlin/managers/Composer.kt index 3347275446082..2e3428ecdc6b0 100644 --- a/analyzer/src/main/kotlin/managers/Composer.kt +++ b/analyzer/src/main/kotlin/managers/Composer.kt @@ -106,8 +106,8 @@ class Composer( override fun getVersionRequirement(): Requirement = Requirement.buildIvy("[1.5,)") override fun beforeResolution(definitionFiles: List) { - // If all of the directories we are analyzing contain a composer.phar, no global installation of Composer is - // required and hence we skip the version check. + // If all directories we are analyzing contain a composer.phar, no global installation of Composer is required + // and hence we skip the version check. if (definitionFiles.all { File(it.parentFile, COMPOSER_PHAR_BINARY).isFile }) return // We do not actually depend on any features specific to a version of Composer, but we still want to stick to diff --git a/analyzer/src/main/kotlin/managers/Npm.kt b/analyzer/src/main/kotlin/managers/Npm.kt index afd6a0f514449..8d600d91dddb0 100644 --- a/analyzer/src/main/kotlin/managers/Npm.kt +++ b/analyzer/src/main/kotlin/managers/Npm.kt @@ -136,7 +136,7 @@ open class Npm( // a private or unpublished package under any terms", which corresponds to SPDX's "NONE". declaredLicense == "UNLICENSED" -> SpdxConstants.NONE - // NPM allows to declare non-SPDX licenses only by referencing a license file. Avoid reporting an + // NPM allows declaring non-SPDX licenses only by referencing a license file. Avoid reporting an // [OrtIssue] by mapping this to a valid license identifier. declaredLicense.startsWith("SEE LICENSE IN ") -> SpdxConstants.NOASSERTION diff --git a/analyzer/src/main/kotlin/managers/Pip.kt b/analyzer/src/main/kotlin/managers/Pip.kt index 8a73ca3691e60..0ee90cd5acf0f 100644 --- a/analyzer/src/main/kotlin/managers/Pip.kt +++ b/analyzer/src/main/kotlin/managers/Pip.kt @@ -124,7 +124,7 @@ object PythonVersion : CommandLineTool { /** * Return the absolute path to the Python interpreter for the given [version]. This is helpful as esp. on Windows - * different Python versions can by installed in arbitrary locations, and the Python executable is even usually + * different Python versions can be installed in arbitrary locations, and the Python executable is even usually * called the same in those locations. Return `null` if no matching Python interpreter is available. */ fun getPythonInterpreter(version: Int): String? = @@ -495,7 +495,7 @@ class Pip( } private fun installDependencies(workingDir: File, definitionFile: File, virtualEnvDir: File): ProcessCapture { - // Ensure to have installed a version of pip that is know to work for us. + // Ensure to have installed a version of pip that is known to work for us. var pip = if (Os.isWindows) { // On Windows, in-place pip up- / downgrades require pip to be wrapped by "python -m", see // https://github.com/pypa/pip/issues/1299. @@ -753,7 +753,7 @@ private fun Package.enrichWith(other: Package?): Package = * Normalize all PyPI package names to be lowercase and hyphenated as per PEP 426 and 503: * * PEP 426 (https://www.python.org/dev/peps/pep-0426/#name): - * "All comparisons of distribution names MUST be case insensitive, + * "All comparisons of distribution names MUST be case-insensitive, * and MUST consider hyphens and underscores to be equivalent". * * PEP 503 (https://www.python.org/dev/peps/pep-0503/#normalized-names): diff --git a/analyzer/src/main/kotlin/managers/Pub.kt b/analyzer/src/main/kotlin/managers/Pub.kt index c07b71db1a180..4c72ef2a7f6b8 100644 --- a/analyzer/src/main/kotlin/managers/Pub.kt +++ b/analyzer/src/main/kotlin/managers/Pub.kt @@ -314,7 +314,7 @@ class Pub( val pkgInfoFromLockFile = lockFile["packages"][packageName] // If the package is marked as SDK (e.g. flutter, flutter_test, dart) we cannot resolve it correctly as - // it is not stored in .pub-cache. For now we just ignore those SDK packages. + // it is not stored in .pub-cache. For now, we just ignore those SDK packages. if (pkgInfoFromLockFile == null || pkgInfoFromLockFile["source"].textValueOrEmpty() == "sdk") return@forEach val id = Identifier( diff --git a/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt b/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt index f52cea7a1c16a..cb6be0a03bae2 100644 --- a/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt +++ b/analyzer/src/main/kotlin/managers/utils/MavenSupport.kt @@ -825,7 +825,7 @@ private class SkipBinaryDownloadsWorkspaceReader( * Locate the given artifact on the local disk. This implementation does a correct location only for POM files; * for all other artifacts it returns a non-null file. Note: For the purpose of analyzing the project's * dependencies the artifact files are never accessed. Therefore, the concrete file returned here does not - * actually matter; it just have to be non-null to indicate that the artifact is present locally. + * actually matter; it just has to be non-null to indicate that the artifact is present locally. */ override fun findArtifact(artifact: Artifact): File? { return if (artifact.extension == "pom") { diff --git a/cli/src/main/kotlin/commands/UploadResultToSw360Command.kt b/cli/src/main/kotlin/commands/UploadResultToSw360Command.kt index 67c7952d49b5f..d6637811d52e7 100644 --- a/cli/src/main/kotlin/commands/UploadResultToSw360Command.kt +++ b/cli/src/main/kotlin/commands/UploadResultToSw360Command.kt @@ -105,15 +105,14 @@ class UploadResultToSw360Command : CliktCommand( if (attachSources) { val tempDirectory = createOrtTempDir(pkg.id.toPath()) try { - // First, download the sources of the package into a sources directory, whose parent directory + // First, download the sources of the package into a source directory, whose parent directory // is temporary. val sourcesDirectory = tempDirectory.resolve("sources") downloader.download(pkg, sourcesDirectory) - // After downloading the source files successfully in a sources directory, create a - // ZIP file of the sources directory and save it in the root directory of it. - // Finally the created ZIP file of the sources can be uploaded to SW360 as an attachment - // of the release. + // After downloading the source files successfully in a source directory, create a ZIP file of + // the sources directory and save it in the root directory of it. Finally, the created ZIP file + // of the sources can be uploaded to SW360 as an attachment of the release. val zipFile = tempDirectory.resolve("${pkg.id.toPath("-")}.zip") val archiveResult = sourcesDirectory.packZip(zipFile) diff --git a/clients/README.md b/clients/README.md index 2672371f0b4de..5fedbbd15fb91 100644 --- a/clients/README.md +++ b/clients/README.md @@ -1,2 +1,2 @@ -This sub-directory contains modules that are generic (REST) API clients for the respective services. They do not depend +This subdirectory contains modules that are generic (REST) API clients for the respective services. They do not depend on ORT (but ORT depends on them) and they might be outsourced as separate projects at some point. diff --git a/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt b/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt index 8799803799bda..16b5ef8926db3 100644 --- a/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt +++ b/clients/clearly-defined/src/main/kotlin/ClearlyDefinedService.kt @@ -192,7 +192,7 @@ interface ClearlyDefinedService { /** * Search for existing definitions based on the [pattern] string provided, see * https://api.clearlydefined.io/api-docs/#/definitions/get_definitions. This function represents the part of - * the definitions endpoint that allows searching for package coordinates based on a pattern. The pattern string + * the definition's endpoint that allows searching for package coordinates based on a pattern. The pattern string * should contain the parts of the coordinates (typically namespace, name, and version) relevant for the search. * Result is a list with the ClearlyDefined URIs to all the definitions that are matched by the pattern. */ diff --git a/clients/scanoss/src/main/kotlin/model/Model.kt b/clients/scanoss/src/main/kotlin/model/Model.kt index 06d7edcdeed37..aca4b3b11c553 100644 --- a/clients/scanoss/src/main/kotlin/model/Model.kt +++ b/clients/scanoss/src/main/kotlin/model/Model.kt @@ -153,7 +153,7 @@ data class Vulnerability( */ @Serializable enum class VulnerabilitySource { - /** Github Advisories. */ + /** GitHub Advisories. */ @SerialName("github_advisories") GITHUB_ADVISORIES, diff --git a/detekt-rules/src/main/kotlin/OrtImportOrder.kt b/detekt-rules/src/main/kotlin/OrtImportOrder.kt index 88fb60db8dbf1..8fa0f7aac3161 100644 --- a/detekt-rules/src/main/kotlin/OrtImportOrder.kt +++ b/detekt-rules/src/main/kotlin/OrtImportOrder.kt @@ -57,7 +57,7 @@ class OrtImportOrder(config: Config) : Rule(config) { is KtImportDirective -> psi.importPath.toString() // Between two imports there is a child PSI of type whitespace. // For 'n' blank lines in between, the text of this child contains - // 'n + 1' line breaks. Thus a single blank line is represented by "\n\n". + // 'n + 1' line breaks. Thus, a single blank line is represented by "\n\n". is PsiWhiteSpace -> if (psi.text == "\n\n") "" else null else -> null } diff --git a/downloader/src/main/kotlin/Downloader.kt b/downloader/src/main/kotlin/Downloader.kt index 55f9ecb666374..cfb6a9c78dcf8 100644 --- a/downloader/src/main/kotlin/Downloader.kt +++ b/downloader/src/main/kotlin/Downloader.kt @@ -129,7 +129,7 @@ class Downloader(private val config: DownloaderConfiguration) { } /** - * Try to download the source code from the sources artifact. Returns null if the download failed adds the + * Try to download the source code from the source artifact. Returns null if the download failed adds the * suppressed exception to [exception]. */ private fun handleSourceArtifactDownload( @@ -249,7 +249,7 @@ class Downloader(private val config: DownloaderConfiguration) { // non-strict mode. val vcsUrlNoCredentials = pkg.vcsProcessed.url.replaceCredentialsInUri() if (vcsUrlNoCredentials != pkg.vcsProcessed.url) { - // Try once more with any user name / password stripped from the URL. + // Try once more with any username / password stripped from the URL. log.info { "Falling back to trying to download from $vcsUrlNoCredentials which has credentials removed." } @@ -350,7 +350,7 @@ class Downloader(private val config: DownloaderConfiguration) { /** * Consolidate [projects] based on their VcsInfo without taking the path into account. As we store VcsInfo per project - * but many project definition files actually reside in different sub-directories of the same VCS working tree, it does + * but many project definition files actually reside in different subdirectories of the same VCS working tree, it does * not make sense to download (and scan) all of them individually, not even if doing sparse checkouts. Return a map that * associates packages for projects in distinct VCS working trees with all other projects from the same VCS working * tree. diff --git a/downloader/src/main/kotlin/VcsHost.kt b/downloader/src/main/kotlin/VcsHost.kt index 36cf042d54dc8..d8e7a48ae1a14 100644 --- a/downloader/src/main/kotlin/VcsHost.kt +++ b/downloader/src/main/kotlin/VcsHost.kt @@ -580,7 +580,7 @@ private fun toGitPermalink( if (revision.isNotEmpty()) { // GitHub and GitLab are tolerant about "blob" vs. "tree" here, but SourceHut requires "tree" also for files. val gitObject = if (path.isNotEmpty()) { - // Markdown files are usually rendered and can only link to lines in blame view. + // Markdown files are usually rendered and can only link to lines in the blame view. if (path.isPathToMarkdownFile() && startLine != -1) "blame" else "tree" } else { "commit" diff --git a/downloader/src/main/kotlin/VersionControlSystem.kt b/downloader/src/main/kotlin/VersionControlSystem.kt index 8cd0589e4e8d4..d74509cdb8c96 100644 --- a/downloader/src/main/kotlin/VersionControlSystem.kt +++ b/downloader/src/main/kotlin/VersionControlSystem.kt @@ -272,7 +272,7 @@ abstract class VersionControlSystem { * [allowMovingRevisions] toggles whether candidates with symbolic names that point to moving revisions, like Git * branches, are accepted or not. * - * Revision candidates are created from the [processed VCS information[Package.vcsProcessed] of the [package][pkg] + * Revision candidates are created from the [processed VCS information][Package.vcsProcessed] of the [package][pkg] * and from [guessing revisions][WorkingTree.guessRevisionName] based on the name and version of the [package][pkg]. * This is useful when the metadata of the package does not contain a revision or if the revision points to a * non-fetchable commit, but the repository still has a tag for the package version. diff --git a/downloader/src/main/kotlin/vcs/Subversion.kt b/downloader/src/main/kotlin/vcs/Subversion.kt index ceb445609cb03..660f749d8a13c 100644 --- a/downloader/src/main/kotlin/vcs/Subversion.kt +++ b/downloader/src/main/kotlin/vcs/Subversion.kt @@ -215,7 +215,7 @@ class Subversion : VersionControlSystem() { // Then update the working tree in the current revision along the requested path, and ... updateEmptyPath(workingTree, SVNRevision.HEAD, path) - // finally deepen only the requested path in the current revision. + // Finally, deepen only the requested path in the current revision. clientManager.updateClient.apply { isIgnoreExternals = !recursive }.doUpdate( workingTree.workingDir.resolve(path), SVNRevision.HEAD, diff --git a/evaluator/src/main/kotlin/RuleMatcher.kt b/evaluator/src/main/kotlin/RuleMatcher.kt index 3f1d458aed5ed..7748a7b5d7f5e 100644 --- a/evaluator/src/main/kotlin/RuleMatcher.kt +++ b/evaluator/src/main/kotlin/RuleMatcher.kt @@ -35,7 +35,7 @@ interface RuleMatcher { } /** - * A [RuleMatcher] that requires all of the provided [matchers] to match. + * A [RuleMatcher] that requires all provided [matchers] to match. */ class AllOf(private vararg val matchers: RuleMatcher) : RuleMatcher { override val description = "(${matchers.joinToString(" && ") { it.description }})" diff --git a/integrations/tekton/README.md b/integrations/tekton/README.md index 6366f043fb484..00c2e9b4f7577 100644 --- a/integrations/tekton/README.md +++ b/integrations/tekton/README.md @@ -13,7 +13,7 @@ The pipeline is defined in `ort-pipeline.yaml`. You will need to replace `ort:la The pipeline takes a few inputs: * `shared-data` is a workspace and will need a volume, it's used for checking out the source code repo, and storing the temporary artifacts -* `gcs-credentials` is a workspace and will need a volume. On GKE you can use Workload Identities to allow the Kubernetes Service Account (KSA) to access the GCS bucket for uploading the results. (If you are not using Workload Idenity, find more information how to configure credentials in the [gcs-upload](https://hub.tekton.dev/tekton/task/gcs-upload) documentation). +* `gcs-credentials` is a workspace and will need a volume. On GKE, you can use Workload Identities to allow the Kubernetes Service Account (KSA) to access the GCS bucket for uploading the results. (If you are not using Workload Idenity, find more information how to configure credentials in the [gcs-upload](https://hub.tekton.dev/tekton/task/gcs-upload) documentation). * `repo-url` is a param, and takes the path to the Git repo that should be scanned. * `result-bucket-path` is a parameter, and takes the path to GCS where the result report should be stored e.g. gs:///. @@ -26,4 +26,4 @@ In order to get started call `kubectl apply -f ort-pipeline.yaml` to create the ## Next Steps You probably don't want to trigger each execution via `kubectl`. Check out the [Tekton documentation](https://tekton.dev/docs/triggers/) to learn how you can trigger a _PipelineRun_ via _EventListeneres_. -If you aren't working on a public GitHub repository you should also checkout how to work with a [private repo](https://hub.tekton.dev/tekton/task/git-clone). \ No newline at end of file +If you aren't working on a public GitHub repository you should also check out how to work with a [private repo](https://hub.tekton.dev/tekton/task/git-clone). \ No newline at end of file diff --git a/model/src/main/kotlin/CompatibilityDependencyNavigator.kt b/model/src/main/kotlin/CompatibilityDependencyNavigator.kt index a1b9b389c76dd..b4738b04a0f5f 100644 --- a/model/src/main/kotlin/CompatibilityDependencyNavigator.kt +++ b/model/src/main/kotlin/CompatibilityDependencyNavigator.kt @@ -25,10 +25,10 @@ package org.ossreviewtoolkit.model * * While in future newly written [OrtResult] files are going to use the dependency graph format exclusively, existing * files may still store their dependency information in the classic dependency tree format, or even in a mixture of - * both formats (if some of the package managers in use have already been ported to the new format while others have - * not). In such a constellation, it has to be decided on a per project basis, how dependency information has to be - * accessed. This is exactly what this implementation does: For each request, it determines the dependency format of - * the project in question and then delegates to a corresponding [DependencyNavigator] instance. + * both formats (if some package managers in use have already been ported to the new format while others have not). In + * such a constellation, it has to be decided on a per-project basis, how dependency information has to be accessed. + * This is exactly what this implementation does: For each request, it determines the dependency format of the project + * in question and then delegates to a corresponding [DependencyNavigator] instance. */ class CompatibilityDependencyNavigator internal constructor( /** The [DependencyNavigator] to handle projects using the graph format. */ diff --git a/model/src/main/kotlin/DependencyGraph.kt b/model/src/main/kotlin/DependencyGraph.kt index 72c967f47454c..f1c3f3493d573 100644 --- a/model/src/main/kotlin/DependencyGraph.kt +++ b/model/src/main/kotlin/DependencyGraph.kt @@ -53,7 +53,7 @@ typealias NodeDependencies = Map> * not have to be repeated over and over: All the references to packages are expressed by indices into this list. * - *nodes*: An ordered list with the nodes of the dependency graph. A single node represents a package, and * therefore has a reference into the list with package coordinates. It can, however, happen that packages occur - * multiple times in the graph if they are in different sub trees with different sets of transitive dependencies. + * multiple times in the graph if they are in different subtrees with different sets of transitive dependencies. * Then there are multiple nodes for the packages affected, and a *fragmentIndex* is used to identify them uniquely. * Nodes also store information about issues of a package and their linkage. * - *edges*: Here the structure of the graph comes in. Each edge connects two nodes and represents a directed diff --git a/model/src/main/kotlin/DependencyNavigator.kt b/model/src/main/kotlin/DependencyNavigator.kt index d98310346d660..cc6a5212ad731 100644 --- a/model/src/main/kotlin/DependencyNavigator.kt +++ b/model/src/main/kotlin/DependencyNavigator.kt @@ -46,7 +46,7 @@ interface DependencyNavigator { val MATCH_ALL: DependencyMatcher = { true } /** - * A pre-defined [DependencyMatcher] that matches only dependencies with a linkage indicating sub projects. + * A pre-defined [DependencyMatcher] that matches only dependencies with a linkage indicating subprojects. */ private val MATCH_SUB_PROJECTS: DependencyMatcher = { node -> node.linkage in PackageLinkage.PROJECT_LINKAGE @@ -147,7 +147,7 @@ interface DependencyNavigator { } /** - * Return the set of [Identifier]s that refer to sub-projects of the given [project]. + * Return the set of [Identifier]s that refer to subprojects of the given [project]. */ fun collectSubProjects(project: Project): Set = scopeDependencies(project, matcher = MATCH_SUB_PROJECTS).collectDependencies() @@ -177,7 +177,7 @@ interface DependencyNavigator { collectIssues(scopeNames(project).asSequence().flatMap { directDependencies(project, it) }) /** - * Determine the map of shortest paths for all the dependencies of a [project], given its map of + * Determine the map of the shortest paths for all the dependencies of a [project], given its map of * [scopeDependencies]. */ private fun getShortestPathForScope( @@ -187,7 +187,7 @@ interface DependencyNavigator { getShortestPathsForScope(directDependencies(project, scope), dependenciesForScope(project, scope)) /** - * Determine the map of shortest paths for a specific scope given its direct dependency [nodes] and a set with + * Determine the map of the shortest paths for a specific scope given its direct dependency [nodes] and a set with * [allDependencies]. */ private fun getShortestPathsForScope( diff --git a/model/src/main/kotlin/OrtResult.kt b/model/src/main/kotlin/OrtResult.kt index 76d563285bcb4..111627ca819cf 100644 --- a/model/src/main/kotlin/OrtResult.kt +++ b/model/src/main/kotlin/OrtResult.kt @@ -186,7 +186,7 @@ data class OrtResult( } /** - * Return the set of all project or package identifiers in the result, optionally [including those of sub-projects] + * Return the set of all project or package identifiers in the result, optionally [including those of subprojects] * [includeSubProjects]. */ fun collectProjectsAndPackages(includeSubProjects: Boolean = true): Set { diff --git a/model/src/main/kotlin/PackageLinkage.kt b/model/src/main/kotlin/PackageLinkage.kt index ca179d3b5cee7..10d95f944aee7 100644 --- a/model/src/main/kotlin/PackageLinkage.kt +++ b/model/src/main/kotlin/PackageLinkage.kt @@ -36,20 +36,20 @@ enum class PackageLinkage { STATIC, /** - * A dynamically linked package whose source code is part of the project itself, e.g. a sub-project of a + * A dynamically linked package whose source code is part of the project itself, e.g. a subproject of a * multi-project. */ PROJECT_DYNAMIC, /** - * A statically linked package whose source code is part of the project itself, e.g. a sub-project of a + * A statically linked package whose source code is part of the project itself, e.g. a subproject of a * multi-project. */ PROJECT_STATIC; companion object { /** - * A set of linkage types that all refer to a sub-project in a multi-project. + * A set of linkage types that all refer to a subproject in a multi-project. */ val PROJECT_LINKAGE = setOf(PROJECT_DYNAMIC, PROJECT_STATIC) } diff --git a/model/src/main/kotlin/config/RuleViolationResolutionReason.kt b/model/src/main/kotlin/config/RuleViolationResolutionReason.kt index bd9ee59d47e54..deaba715652c7 100644 --- a/model/src/main/kotlin/config/RuleViolationResolutionReason.kt +++ b/model/src/main/kotlin/config/RuleViolationResolutionReason.kt @@ -41,7 +41,7 @@ enum class RuleViolationResolutionReason { LICENSE_ACQUIRED_EXCEPTION, /** - * The rule violation is acceptable given the fact that the code it relates to has not be modified. + * The rule violation is acceptable given the fact that the code it relates to has not been modified. */ NOT_MODIFIED_EXCEPTION, diff --git a/model/src/main/kotlin/config/ScanStorageConfiguration.kt b/model/src/main/kotlin/config/ScanStorageConfiguration.kt index a773192eb7fd2..77a6e38f20a74 100644 --- a/model/src/main/kotlin/config/ScanStorageConfiguration.kt +++ b/model/src/main/kotlin/config/ScanStorageConfiguration.kt @@ -160,7 +160,7 @@ data class Sw360StorageConfiguration( val password: String = "", /** - * The client ID of the SW360 instance for the two step authentication. + * The client ID of the SW360 instance for the two-step authentication. */ val clientId: String, diff --git a/model/src/main/kotlin/licenses/LicenseClassifications.kt b/model/src/main/kotlin/licenses/LicenseClassifications.kt index 26626596c642e..17dedda3921a3 100644 --- a/model/src/main/kotlin/licenses/LicenseClassifications.kt +++ b/model/src/main/kotlin/licenses/LicenseClassifications.kt @@ -29,7 +29,7 @@ import org.ossreviewtoolkit.utils.spdx.SpdxExpression import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression /** - * Classifications for licenses which allow to assign metadata to licenses. This allows defining rather generic + * Classifications for licenses which allow assigning metadata to licenses. This allows defining rather generic * categories and assigning licenses to these. That way flexible classifications can be created based on * customizable categories. The available license categories need to be declared explicitly; when creating an * instance, it is checked that all the references from the [categorizations] point to existing [categories]. diff --git a/model/src/main/kotlin/utils/RootLicenseMatcher.kt b/model/src/main/kotlin/utils/RootLicenseMatcher.kt index 9ee06454e60d9..555a3488c5c81 100644 --- a/model/src/main/kotlin/utils/RootLicenseMatcher.kt +++ b/model/src/main/kotlin/utils/RootLicenseMatcher.kt @@ -31,7 +31,7 @@ import org.ossreviewtoolkit.utils.common.getAllAncestorDirectories * * For any given directory the heuristic tries to assign license files by utilizing * [LicenseFilenamePatterns.licenseFilenames] and patent files by utilizing [LicenseFilenamePatterns.patentFilenames] - * independently from one another. The [LicenseFilenamePatterns.rootLicenseFilenames] serve only as fallback to find + * independently of one another. The [LicenseFilenamePatterns.rootLicenseFilenames] serve only as fallback to find * license files if there isn't any match for [LicenseFilenamePatterns.licenseFilenames]. * * To determine the (root) license files applicable for a specific directory, all filenames in that directory are diff --git a/reporter/build.gradle.kts b/reporter/build.gradle.kts index 72511be1dd412..2ab9a3b7362f1 100644 --- a/reporter/build.gradle.kts +++ b/reporter/build.gradle.kts @@ -74,7 +74,7 @@ dependencies { implementation(libs.poiOoxml) implementation(libs.retrofit) - // This is required to not depend on the version of Apache Xalan bundled with the JDK. Otherwise the formatting of + // This is required to not depend on the version of Apache Xalan bundled with the JDK. Otherwise, the formatting of // the HTML generated in StaticHtmlReporter is slightly different with different Java versions. implementation(libs.saxonHe) diff --git a/reporter/src/main/kotlin/Reporter.kt b/reporter/src/main/kotlin/Reporter.kt index 30b44fb1f3d01..d868c41def9d8 100644 --- a/reporter/src/main/kotlin/Reporter.kt +++ b/reporter/src/main/kotlin/Reporter.kt @@ -30,7 +30,7 @@ import org.ossreviewtoolkit.model.config.ScopeExclude import org.ossreviewtoolkit.utils.common.joinNonBlank /** - * A reporter that creates a human readable report from the [AnalyzerResult] and [ScanRecord] contained in an + * A reporter that creates a human-readable report from the [AnalyzerResult] and [ScanRecord] contained in an * [OrtResult]. The signatures of public functions in this class define the library API. */ interface Reporter { diff --git a/reporter/src/main/kotlin/reporters/CycloneDxReporter.kt b/reporter/src/main/kotlin/reporters/CycloneDxReporter.kt index ed67a1702b0b9..e3aaec5766994 100644 --- a/reporter/src/main/kotlin/reporters/CycloneDxReporter.kt +++ b/reporter/src/main/kotlin/reporters/CycloneDxReporter.kt @@ -158,7 +158,7 @@ class CycloneDxReporter : Reporter { // - If a multi-module project only produces a single application that gets distributed, then usually only a // single BOM for that application is generated. // - If a multi-module project produces multiple applications (e.g. if there is one module per independent - // micro-service), then usually for each project a BOM is generated as there are multiple things being + // microservice), then usually for each project a BOM is generated as there are multiple things being // distributed. // // As this distinction is hard to make programmatically (without additional information about the @@ -238,7 +238,7 @@ class CycloneDxReporter : Reporter { val declaredLicenseNames = resolvedLicenseInfo.getLicenseNames(LicenseSource.DECLARED) val detectedLicenseNames = resolvedLicenseInfo.getLicenseNames(LicenseSource.DETECTED) - // Get all licenses, but note down their origins inside of an extensible type. + // Get all licenses, but note down their origins inside an extensible type. val licenseObjects = mapLicenseNamesToObjects(concludedLicenseNames, "concluded license", input) + mapLicenseNamesToObjects(declaredLicenseNames, "declared license", input) + mapLicenseNamesToObjects(detectedLicenseNames, "detected license", input) diff --git a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt index 2acf8c6f22c0a..d344d08cda623 100644 --- a/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt +++ b/reporter/src/main/kotlin/reporters/evaluatedmodel/EvaluatedModel.kt @@ -74,7 +74,7 @@ import org.ossreviewtoolkit.reporter.reporters.WebAppReporter * * Use cases for the [EvaluatedModel] are: * - * * Input for the [WebAppReporter], so that it does not have to evaluate the model at runtime. Currently the model is + * * Input for the [WebAppReporter], so that it does not have to evaluate the model at runtime. Currently, the model is * optimized for this use case. * * Input for [Reporter] implementations, so that they do not have to repeatedly implement the application of excludes, * resolutions, and so on. @@ -84,7 +84,7 @@ import org.ossreviewtoolkit.reporter.reporters.WebAppReporter * * * The model uses Kotlin data classes with cyclic dependencies, therefore the [hashCode] and [toString] of affected * classes cannot be used, because they would create stack overflows. - * * When modifying the model make sure that the objects are serialized at the right place. By default Jackson + * * When modifying the model make sure that the objects are serialized at the right place. By default, Jackson * serializes an Object with [ObjectIdInfo] the first time the serializer sees the object. If this is not desired * because the object shall be serialized as the generated ID, the [JsonIdentityReference] annotation can be used to * enforce this. For example, the list of [EvaluatedOrtIssue]s is serialized before the list of [EvaluatedPackage]s. diff --git a/reporter/src/main/kotlin/reporters/fossid/FossIdReporter.kt b/reporter/src/main/kotlin/reporters/fossid/FossIdReporter.kt index 512fbf673c1d4..abe247c959b5f 100644 --- a/reporter/src/main/kotlin/reporters/fossid/FossIdReporter.kt +++ b/reporter/src/main/kotlin/reporters/fossid/FossIdReporter.kt @@ -45,7 +45,7 @@ class FossIdReporter : Reporter { /** Name of the configuration property for the API key. */ const val API_KEY_PROPERTY = "apiKey" - /** Name of the configuration property for the user name. */ + /** Name of the configuration property for the username. */ const val USER_PROPERTY = "user" /** Name of the configuration property for the report type. Default is [ReportType.HTML_DYNAMIC]. */ diff --git a/reporter/src/main/kotlin/reporters/freemarker/NoticeTemplateReporter.kt b/reporter/src/main/kotlin/reporters/freemarker/NoticeTemplateReporter.kt index 1d21b1d3b3ac1..fa2465ae3d831 100644 --- a/reporter/src/main/kotlin/reporters/freemarker/NoticeTemplateReporter.kt +++ b/reporter/src/main/kotlin/reporters/freemarker/NoticeTemplateReporter.kt @@ -31,7 +31,7 @@ import org.ossreviewtoolkit.reporter.ReporterInput * careful to not use two different templates with the same name. * * This reporter supports the following options: - * - *template.id*: A comma-separated list of IDs of templates provided by ORT. Currently only the "default" + * - *template.id*: A comma-separated list of IDs of templates provided by ORT. Currently, only the "default" * and "summary" templates are available. * - *template.path*: A comma-separated list of paths to template files provided by the user. * - *project-types-as-packages: A comma-separated list of project types to be handled as packages. diff --git a/reporter/src/main/kotlin/reporters/spdx/SpdxDocumentReporter.kt b/reporter/src/main/kotlin/reporters/spdx/SpdxDocumentReporter.kt index d0ac1f0e00051..e05fd4740f44d 100644 --- a/reporter/src/main/kotlin/reporters/spdx/SpdxDocumentReporter.kt +++ b/reporter/src/main/kotlin/reporters/spdx/SpdxDocumentReporter.kt @@ -28,7 +28,7 @@ import org.ossreviewtoolkit.utils.spdx.model.SpdxDocument /** * Creates YAML and JSON SPDX documents mainly targeting the use case of sharing information about the dependencies - * used, similar to e.g. a NOTICE file. Information about the project / sub-module structure as well as project VCS + * used, similar to e.g. a NOTICE file. Information about the project / submodule structure as well as project VCS * locations are deliberately omitted. The underlying idea is to clearly separate this mentioned use case from a maximum * detailed report which could be preferred for archiving or internal use only. The latter could be implemented either * as a future extension of this [SpdxDocumentReporter] or as a separate [Reporter]. diff --git a/scanner/src/funTest/kotlin/scanners/AbstractScannerFunTest.kt b/scanner/src/funTest/kotlin/scanners/AbstractScannerFunTest.kt index 7ab9be3aa2247..0c07ed40fb45f 100644 --- a/scanner/src/funTest/kotlin/scanners/AbstractScannerFunTest.kt +++ b/scanner/src/funTest/kotlin/scanners/AbstractScannerFunTest.kt @@ -53,7 +53,7 @@ abstract class AbstractScannerFunTest(testTags: Set = emptySet()) : StringS override suspend fun beforeSpec(spec: Spec) { inputDir = createSpecTempDir() - // Copy our own root license under different names to a temporary directory so we have something to operate on. + // Copy our own root license under different names to a temporary directory, so we have something to operate on. val ortLicense = File("../LICENSE") commonlyDetectedFiles.forEach { val text = ortLicense.readText() diff --git a/scanner/src/main/kotlin/scanners/fossid/FossId.kt b/scanner/src/main/kotlin/scanners/fossid/FossId.kt index 0b33210b69ac8..faa291660ac04 100644 --- a/scanner/src/main/kotlin/scanners/fossid/FossId.kt +++ b/scanner/src/main/kotlin/scanners/fossid/FossId.kt @@ -397,7 +397,7 @@ class FossId internal constructor( revision: String? = null ): List = filter { val isArchived = it.isArchived ?: false - // The scans in the server contain the url with the credentials so we have to remove it for the + // The scans in the server contain the url with the credentials, so we have to remove it for the // comparison. If we don't, the scans won't be matched if the password changes! val urlWithoutCredentials = it.gitRepoUrl?.replaceCredentialsInUri() !isArchived && urlWithoutCredentials == url && (revision == null || it.gitBranch == revision) diff --git a/scanner/src/main/kotlin/scanners/fossid/FossIdNamingProvider.kt b/scanner/src/main/kotlin/scanners/fossid/FossIdNamingProvider.kt index d8eda6d6e561a..01ef62dfcc9e3 100644 --- a/scanner/src/main/kotlin/scanners/fossid/FossIdNamingProvider.kt +++ b/scanner/src/main/kotlin/scanners/fossid/FossIdNamingProvider.kt @@ -35,7 +35,7 @@ import org.ossreviewtoolkit.utils.ort.log * Available builtin variables: * * **projectName**: The name of the project (i.e. the part of the URL before .git). * * **currentTimestamp**: The current time. - * * **deltaTag** (scan code only): If delta scans is enabled, this qualify the scan as an *origin* scan or a *delta* + * * **deltaTag** (scan code only): If delta scans is enabled, this qualifies the scan as an *origin* scan or a *delta* * scan. */ internal class FossIdNamingProvider( diff --git a/scanner/src/main/kotlin/storages/CompositeStorage.kt b/scanner/src/main/kotlin/storages/CompositeStorage.kt index a58ea7b021333..56612e10fb3b0 100644 --- a/scanner/src/main/kotlin/storages/CompositeStorage.kt +++ b/scanner/src/main/kotlin/storages/CompositeStorage.kt @@ -97,7 +97,7 @@ class CompositeStorage( /** * Trigger all configured writer storages to add the [scanResult] for the given [id]. Return a success result - * if all of the writers are successful; otherwise return a failure result with an accumulated error message. + * if all writers are successful; otherwise return a failure result with an accumulated error message. */ override fun addInternal(id: Identifier, scanResult: ScanResult): Result { val writeResults = writers.map { it.add(id, scanResult) } diff --git a/scanner/src/main/kotlin/storages/utils/JsonbSupport.kt b/scanner/src/main/kotlin/storages/utils/JsonbSupport.kt index 199fc055e48f8..8f3d8bb99ceed 100644 --- a/scanner/src/main/kotlin/storages/utils/JsonbSupport.kt +++ b/scanner/src/main/kotlin/storages/utils/JsonbSupport.kt @@ -58,7 +58,7 @@ private class JsonbColumnType(private val klass: KClass) : ColumnTyp fun Table.jsonb(name: String, klass: KClass): Column = registerColumn(name, JsonbColumnType(klass)) /** - * The null character "\u0000" is not allowed in PostgreSQL JSONB columns so we need to escape it before writing a + * The null character "\u0000" is not allowed in PostgreSQL JSONB columns, so we need to escape it before writing a * string to the database. * See: [https://www.postgresql.org/docs/11/datatype-json.html] */ diff --git a/scanner/src/test/kotlin/experimental/ExperimentalScannerTest.kt b/scanner/src/test/kotlin/experimental/ExperimentalScannerTest.kt index e0c545beaec45..721f53ded1fab 100644 --- a/scanner/src/test/kotlin/experimental/ExperimentalScannerTest.kt +++ b/scanner/src/test/kotlin/experimental/ExperimentalScannerTest.kt @@ -630,9 +630,9 @@ class ExperimentalScannerTest : WordSpec({ provenanceWithoutVcsPath, scannerWrapper.details, sortedSetOf( - // Add a license finding outside of the subdirectory that is matched by a license file pattern. + // Add a license finding outside the subdirectory that is matched by a license file pattern. LicenseFinding("Apache-2.0", TextLocation("LICENSE", 1, 1)), - // Add a license finding outside of the subdirectory that is not matched by a license file pattern. + // Add a license finding outside the subdirectory that is not matched by a license file pattern. LicenseFinding("Apache-2.0", TextLocation("other", 1, 1)), // Add a license finding inside the subdirectory. LicenseFinding("Apache-2.0", TextLocation("subdirectory/file", 1, 1)) @@ -652,7 +652,7 @@ class ExperimentalScannerTest : WordSpec({ provenanceWithVcsPath, scannerWrapper.details, sortedSetOf( - // Add a license finding outside of the subdirectory that is matched by a license file pattern. + // Add a license finding outside the subdirectory that is matched by a license file pattern. LicenseFinding("Apache-2.0", TextLocation("LICENSE", 1, 1)), // Add a license finding inside the subdirectory. LicenseFinding("Apache-2.0", TextLocation("subdirectory/file", 1, 1)) diff --git a/scanner/src/test/kotlin/storages/ClearlyDefinedStorageTest.kt b/scanner/src/test/kotlin/storages/ClearlyDefinedStorageTest.kt index 841e558a81a8a..45fd8b932eed8 100644 --- a/scanner/src/test/kotlin/storages/ClearlyDefinedStorageTest.kt +++ b/scanner/src/test/kotlin/storages/ClearlyDefinedStorageTest.kt @@ -164,7 +164,7 @@ private fun stubHarvestToolResponse(server: WireMockServer, coordinates: Coordin } /** - * Stub a request for the definitions endpoint for the given [coordinates] on the [server] server. + * Stub a request for the definition's endpoint for the given [coordinates] on the [server] server. */ private fun stubDefinitions(server: WireMockServer, coordinates: Coordinates = COORDINATES) { val coordinatesList = listOf(coordinates) diff --git a/utils/common/src/main/kotlin/Extensions.kt b/utils/common/src/main/kotlin/Extensions.kt index d1d95a6ce466b..1214c911030de 100644 --- a/utils/common/src/main/kotlin/Extensions.kt +++ b/utils/common/src/main/kotlin/Extensions.kt @@ -200,7 +200,7 @@ fun File.searchUpwardsForFile(searchFileName: String, ignoreCase: Boolean = fals } /** - * Search [this] directory upwards towards the root until a contained sub-directory called [searchDirName] is found and + * Search [this] directory upwards towards the root until a contained subdirectory called [searchDirName] is found and * return the parent of [searchDirName], or return null if no such directory is found. */ fun File.searchUpwardsForSubdirectory(searchDirName: String): File? { @@ -397,8 +397,8 @@ fun String.percentEncode(): String = .replace("%7E", "~") /** - * Replace any user name / password in the URI represented by this [String] with [userInfo]. If [userInfo] is null, the - * user name / password are stripped. Return the unmodified [String] if it does not represent a URI. + * Replace any username / password in the URI represented by this [String] with [userInfo]. If [userInfo] is null, the + * username / password are stripped. Return the unmodified [String] if it does not represent a URI. */ fun String.replaceCredentialsInUri(userInfo: String? = null) = toUri { diff --git a/utils/ort/src/main/kotlin/OkHttpClientHelper.kt b/utils/ort/src/main/kotlin/OkHttpClientHelper.kt index 4f28c78890ba2..ac03bae73b921 100644 --- a/utils/ort/src/main/kotlin/OkHttpClientHelper.kt +++ b/utils/ort/src/main/kotlin/OkHttpClientHelper.kt @@ -77,7 +77,7 @@ object OkHttpClientHelper { OrtProxySelector.install() if (log.delegate.isDebugEnabled) { - // Allow to track down leaked connections. + // Allow tracking down leaked connections. Logger.getLogger(OkHttpClient::javaClass.name).level = Level.FINE } diff --git a/utils/ort/src/main/kotlin/OrtProxySelector.kt b/utils/ort/src/main/kotlin/OrtProxySelector.kt index c96eb2386433b..352d47af9730b 100644 --- a/utils/ort/src/main/kotlin/OrtProxySelector.kt +++ b/utils/ort/src/main/kotlin/OrtProxySelector.kt @@ -229,7 +229,7 @@ fun determineProxyFromURL(url: String?): AuthenticatedProxy? { if (url == null) return null val uri = runCatching { - // Assume http if no protocol is specified to be able to create an URI. + // Assume http if no protocol is specified to be able to create a URI. URI(url.takeIf { "://" in it } ?: "http://$url") }.getOrElse { return null diff --git a/utils/ort/src/main/kotlin/Utils.kt b/utils/ort/src/main/kotlin/Utils.kt index 028cddca8dd2a..3b0652c6b0a41 100644 --- a/utils/ort/src/main/kotlin/Utils.kt +++ b/utils/ort/src/main/kotlin/Utils.kt @@ -177,8 +177,8 @@ fun normalizeVcsUrl(vcsUrl: String): String { return url } - // URLs to Git repos may omit the scheme and use an scp-like URL that uses ":" to separate the host from the path, - // see https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a. Make this an explicit ssh URL so it can be parsed + // URLs to Git repos may omit the scheme and use an SCP-like URL that uses ":" to separate the host from the path, + // see https://git-scm.com/docs/git-clone#_git_urls_a_id_urls_a. Make this an explicit ssh URL, so it can be parsed // by Java's URI class. url = url.replace(Regex("^(.*)([a-zA-Z]+):([a-zA-Z]+)(.*)$")) { val tail = "${it.groupValues[1]}${it.groupValues[2]}/${it.groupValues[3]}${it.groupValues[4]}" @@ -226,11 +226,11 @@ fun normalizeVcsUrl(vcsUrl: String): String { val query = uri.query?.takeIf { it.isNotBlank() }?.let { "?$it" }.orEmpty() return if (uri.scheme == "ssh") { - // Ensure the generic "git" user name is specified. + // Ensure the generic "git" username is specified. val host = uri.authority.let { if (it.startsWith("git@")) it else "git@$it" } "ssh://$host$path$query" } else { - // Remove any user name and "www" prefix. + // Remove any username and "www" prefix. val host = uri.authority.substringAfter('@').removePrefix("www.") "https://$host$path$query" } diff --git a/utils/spdx/src/main/kotlin/SpdxExpression.kt b/utils/spdx/src/main/kotlin/SpdxExpression.kt index 9da0cc17b2157..4f167eeefeb1d 100644 --- a/utils/spdx/src/main/kotlin/SpdxExpression.kt +++ b/utils/spdx/src/main/kotlin/SpdxExpression.kt @@ -437,7 +437,7 @@ sealed class SpdxSingleLicenseExpression : SpdxExpression() { /** * Return the URL for the licence if this is [SpdxLicenseIdExpression] or [SpdxLicenseWithExceptionExpression]. - * Otherwise return null. + * Otherwise, return null. */ abstract fun getLicenseUrl(): String? } diff --git a/utils/spdx/src/main/kotlin/Utils.kt b/utils/spdx/src/main/kotlin/Utils.kt index 5572bbe48df88..49f31d4d5827e 100644 --- a/utils/spdx/src/main/kotlin/Utils.kt +++ b/utils/spdx/src/main/kotlin/Utils.kt @@ -88,7 +88,7 @@ fun calculatePackageVerificationCode(files: Sequence, excludes: Sequence