From c2659eee462b3b4a46a0b3a3e00ef8f66023043f Mon Sep 17 00:00:00 2001 From: filip Date: Mon, 30 Sep 2024 14:28:50 +0200 Subject: [PATCH] Fix typos --- internal/cmd/report/sbom/sbom.go | 6 +++--- internal/cmd/resolve/resolve.go | 2 +- internal/cmd/scan/scan.go | 10 +++++----- internal/scan/scanner_test.go | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/cmd/report/sbom/sbom.go b/internal/cmd/report/sbom/sbom.go index 83deddb7..670c3beb 100644 --- a/internal/cmd/report/sbom/sbom.go +++ b/internal/cmd/report/sbom/sbom.go @@ -50,13 +50,13 @@ This is an enterprise feature. Please visit https://debricked.com/pricing/ for m cmd.Flags().StringVarP(&branch, BranchFlag, "b", "", "The branch that you want an SBOM report for") viper.MustBindEnv(BranchFlag) - cmd.Flags().BoolVar(&vulnerabilities, VulnerabilitiesFlag, true, "Toggles SBOM vulnerability data inclusion") + cmd.Flags().BoolVar(&vulnerabilities, VulnerabilitiesFlag, true, "Toggle SBOM vulnerability data inclusion") viper.MustBindEnv(VulnerabilitiesFlag) - cmd.Flags().BoolVar(&licenses, LicensesFlag, true, "Toggles SBOM license data inclusion") + cmd.Flags().BoolVar(&licenses, LicensesFlag, true, "Toggle SBOM license data inclusion") viper.MustBindEnv(LicensesFlag) - cmd.Flags().StringVarP(&output, OutputFlag, "o", "", `Sets output path for downloaded SBOM json file. + cmd.Flags().StringVarP(&output, OutputFlag, "o", "", `Set output path for downloaded SBOM json file. If no output path is set the file is created in the format -.sbom.json`, ) diff --git a/internal/cmd/resolve/resolve.go b/internal/cmd/resolve/resolve.go index 282a76f6..8603df37 100644 --- a/internal/cmd/resolve/resolve.go +++ b/internal/cmd/resolve/resolve.go @@ -67,7 +67,7 @@ Examples: $ debricked scan . --include '**/node_modules/**'`) regenerateDoc := strings.Join( []string{ - "Toggles regeneration of already existing lock files between 3 modes:\n", + "Toggle regeneration of already existing lock files between 3 modes:\n", "Force Regeneration Level | Meaning", "------------------------ | -------", "0 (default) | No regeneration", diff --git a/internal/cmd/scan/scan.go b/internal/cmd/scan/scan.go index d814a074..a1781893 100644 --- a/internal/cmd/scan/scan.go +++ b/internal/cmd/scan/scan.go @@ -119,7 +119,7 @@ Examples: $ debricked scan . --include '**/node_modules/**'`) regenerateDoc := strings.Join( []string{ - "Toggles regeneration of already existing lock files between 3 modes:\n", + "Toggle regeneration of already existing lock files between 3 modes:\n", "Force Regeneration Level | Meaning", "------------------------ | -------", "0 (default) | No regeneration", @@ -130,7 +130,7 @@ $ debricked scan . --include '**/node_modules/**'`) cmd.Flags().IntVar(®enerate, RegenerateFlag, 0, regenerateDoc) versionHintDoc := strings.Join( []string{ - "Toggles version hinting, i.e using manifest versions to help manifestless resolution.\n", + "Toggle version hinting, i.e using manifest versions to help manifestless resolution.\n", "\nExample:\n$ debricked scan . --version-hint=false", }, "\n") cmd.Flags().BoolVar(&versionHint, VersionHintFlag, true, versionHintDoc) @@ -143,7 +143,7 @@ $ debricked scan . --include '**/node_modules/**'`) cmd.Flags().BoolVarP(&passOnDowntime, PassOnTimeOut, "p", false, "pass scan if there is a service access timeout") cmd.Flags().BoolVar(&noResolve, NoResolveFlag, false, `disables resolution of manifest files that lack lock files. Resolving manifest files enables more accurate dependency scanning since the whole dependency tree will be analysed. For example, if there is a "go.mod" in the target path, its dependencies are going to get resolved onto a lock file, and latter scanned.`) - cmd.Flags().BoolVar(&noFingerprint, NoFingerprintFlag, true, "toggles fingerprinting for undeclared component identification. Can be run as a standalone command [fingerprint] with more granular options.") + cmd.Flags().BoolVar(&noFingerprint, NoFingerprintFlag, true, "Toggle fingerprinting for undeclared component identification. Can be run as a standalone command [fingerprint] with more granular options.") cmd.Flags().BoolVar(&callgraph, CallGraphFlag, false, `Enables call graph generation during scan.`) cmd.Flags().IntVar(&callgraphUploadTimeout, CallGraphUploadTimeoutFlag, 10*60, "Set a timeout (in seconds) on call graph upload.") cmd.Flags().IntVar(&callgraphGenerateTimeout, CallGraphGenerateTimeoutFlag, 60*60, "Set a timeout (in seconds) on call graph generation.") @@ -154,8 +154,8 @@ For example, if there is a "go.mod" in the target path, its dependencies are goi "Example: debricked resolve --prefer-npm", }, "\n") cmd.Flags().BoolP(NpmPreferredFlag, "", npmPreferred, npmPreferredDoc) - cmd.Flags().BoolVar(&sbom, SBOMFlag, false, `Toggles wether to generate and download an SBOM report after scan completion`) - cmd.Flags().StringVar(&sbomOutput, SBOMOutputFlag, "", `Sets output path of downloaded SBOM report (if sbom is toggled)`) + cmd.Flags().BoolVar(&sbom, SBOMFlag, false, `Toggle generating and downloading SBOM report after scan completion`) + cmd.Flags().StringVar(&sbomOutput, SBOMOutputFlag, "", `Set output path of downloaded SBOM report (if sbom is toggled)`) viper.MustBindEnv(RepositoryFlag) viper.MustBindEnv(CommitFlag) diff --git a/internal/scan/scanner_test.go b/internal/scan/scanner_test.go index 15aa5c86..cbb3e039 100644 --- a/internal/scan/scanner_test.go +++ b/internal/scan/scanner_test.go @@ -834,6 +834,8 @@ func TestScanWithSBOMReport(t *testing.T) { for _, assertion := range outputAssertions { assert.Contains(t, string(output), assertion) } + err = os.Remove("13-37.sbom.json") // Remove created "SBOM" + } func addMockedFormatsResponse(clientMock *testdata.DebClientMock, regex string) {