Skip to content

Commit

Permalink
Several grammatical and spelling corrections throughout the code base
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher authored and sschuberth committed Jun 27, 2022
1 parent 3df0358 commit 909231b
Show file tree
Hide file tree
Showing 53 changed files with 88 additions and 89 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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 |
|---------------|--------|------------------------------------------------|
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion analyzer/src/funTest/kotlin/managers/MavenFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/PackageManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<File, List<ProjectAnalyzerResult>>):
Expand Down
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/managers/Bower.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions analyzer/src/main/kotlin/managers/Cargo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down Expand Up @@ -247,7 +247,7 @@ private fun parseDeclaredLicenses(node: JsonNode): SortedSet<String> {
.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
Expand Down
4 changes: 2 additions & 2 deletions analyzer/src/main/kotlin/managers/Carthage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions analyzer/src/main/kotlin/managers/Composer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class Composer(
override fun getVersionRequirement(): Requirement = Requirement.buildIvy("[1.5,)")

override fun beforeResolution(definitionFiles: List<File>) {
// 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
Expand Down
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/managers/Npm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions analyzer/src/main/kotlin/managers/Pip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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? =
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/managers/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/managers/utils/MavenSupport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
9 changes: 4 additions & 5 deletions cli/src/main/kotlin/commands/UploadResultToSw360Command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion clients/README.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion clients/scanoss/src/main/kotlin/model/Model.kt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ data class Vulnerability(
*/
@Serializable
enum class VulnerabilitySource {
/** Github Advisories. */
/** GitHub Advisories. */
@SerialName("github_advisories")
GITHUB_ADVISORIES,

Expand Down
2 changes: 1 addition & 1 deletion detekt-rules/src/main/kotlin/OrtImportOrder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions downloader/src/main/kotlin/Downloader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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."
}
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion downloader/src/main/kotlin/VcsHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion downloader/src/main/kotlin/VersionControlSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion downloader/src/main/kotlin/vcs/Subversion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion evaluator/src/main/kotlin/RuleMatcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})"
Expand Down
Loading

0 comments on commit 909231b

Please sign in to comment.