Skip to content

Commit

Permalink
fix: adjust phrasing of "called" vs "uncalled" vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 10, 2024
1 parent d1b1b86 commit 347ca61
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
86 changes: 43 additions & 43 deletions internal/output/__snapshots__/vertical_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ path/to/my/second/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithMixedIssues/multiple_sources_with_a_mixed_count_of_packages,_some_called_vulnerabilities_and_license_violations - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 uncalled vulnerability found in path/to/my/first/lockfile
Expand All @@ -217,15 +217,15 @@ path/to/my/first/lockfile: found 1 package with issues

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)

1 known vulnerability found in path/to/my/second/lockfile
no license violations found

path/to/my/third/lockfile: found 2 packages with issues

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 uncalled vulnerability found in path/to/my/third/lockfile
Expand All @@ -241,7 +241,7 @@ path/to/my/third/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithMixedIssues/multiple_sources_with_a_mixed_count_of_packages,_some_vulnerabilities_and_license_violations - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -253,15 +253,15 @@ path/to/my/first/lockfile: found 1 package with issues

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)

1 known vulnerability found in path/to/my/second/lockfile
no license violations found

path/to/my/third/lockfile: found 2 packages with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/third/lockfile
Expand All @@ -277,7 +277,7 @@ path/to/my/third/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithMixedIssues/one_source_with_one_package,_one_called_vulnerability,_and_one_license_violation - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -292,7 +292,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithMixedIssues/one_source_with_one_package,_one_uncalled_vulnerability,_and_one_license_violation - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 uncalled vulnerability found in path/to/my/first/lockfile
Expand All @@ -307,7 +307,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithMixedIssues/one_source_with_one_package,_one_vulnerability,_and_one_license_violation - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -322,7 +322,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithMixedIssues/two_sources_with_packages,_one_vulnerability,_one_license_violation - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -341,19 +341,19 @@ path/to/my/second/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/multiple_sources_with_a_mixed_count_of_grouped_packages,_and_multiple_vulnerabilities - 1]
path/to/my/first/lockfile: found 2 packages with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)
OSV-5: Something scarier! (https://osv.dev/OSV-5)
mine1@1.2.2 is affected by the following vulnerabilities:
mine1@1.2.2 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

3 known vulnerabilities found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)
mine3@0.4.1 is affected by the following vulnerabilities:
mine3@0.4.1 has the following known vulnerabilities:
OSV-3: Something mildly scary! (https://osv.dev/OSV-3)
OSV-5: Something scarier! (https://osv.dev/OSV-5)

Expand All @@ -364,19 +364,19 @@ path/to/my/second/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithVulnerabilities/multiple_sources_with_a_mixed_count_of_packages,_and_multiple_vulnerabilities - 1]
path/to/my/first/lockfile: found 2 packages with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)
OSV-5: Something scarier! (https://osv.dev/OSV-5)
mine1@1.2.2 is affected by the following vulnerabilities:
mine1@1.2.2 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

3 known vulnerabilities found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)
mine3@0.4.1 is affected by the following vulnerabilities:
mine3@0.4.1 has the following known vulnerabilities:
OSV-3: Something mildly scary! (https://osv.dev/OSV-3)
OSV-5: Something scarier! (https://osv.dev/OSV-5)

Expand All @@ -399,21 +399,21 @@ path/to/my/third/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithVulnerabilities/multiple_sources_with_a_mixed_count_of_packages,_some_vulnerabilities - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)

1 known vulnerability found in path/to/my/second/lockfile

path/to/my/third/lockfile: found 2 packages with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/third/lockfile
Expand All @@ -423,19 +423,19 @@ path/to/my/third/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithVulnerabilities/multiple_sources_with_a_mixed_count_of_packages_across_ecosystems,_and_multiple_vulnerabilities - 1]
path/to/my/first/lockfile: found 2 packages with issues

author1/mine1@1.2.3 is affected by the following vulnerabilities:
author1/mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)
OSV-5: Something scarier! (https://osv.dev/OSV-5)
mine1@1.2.2 is affected by the following vulnerabilities:
mine1@1.2.2 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

3 known vulnerabilities found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)
author3/mine3@0.4.1 is affected by the following vulnerabilities:
author3/mine3@0.4.1 has the following known vulnerabilities:
OSV-3: Something mildly scary! (https://osv.dev/OSV-3)
OSV-5: Something scarier! (https://osv.dev/OSV-5)

Expand All @@ -446,23 +446,23 @@ path/to/my/second/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithVulnerabilities/multiple_sources_with_a_mixed_count_of_packages_across_ecosystems,_and_multiple_vulnerabilities,_but_some_uncalled - 1]
path/to/my/first/lockfile: found 2 packages with issues

author1/mine1@1.2.3 is affected by the following vulnerabilities:
author1/mine1@1.2.3 has the following known vulnerabilities:
OSV-5: Something scarier! (https://osv.dev/OSV-5)
mine1@1.2.2 is affected by the following vulnerabilities:
mine1@1.2.2 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

2 known vulnerabilities found in path/to/my/first/lockfile

author1/mine1@1.2.3 may be affected by the following vulnerabilities:
author1/mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 uncalled vulnerability found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 2 packages with issues

mine2@3.2.5 is affected by the following vulnerabilities:
mine2@3.2.5 has the following known vulnerabilities:
OSV-2: Something less scary! (https://osv.dev/OSV-2)
author3/mine3@0.4.1 is affected by the following vulnerabilities:
author3/mine3@0.4.1 has the following known vulnerabilities:
OSV-3: Something mildly scary! (https://osv.dev/OSV-3)
OSV-5: Something scarier! (https://osv.dev/OSV-5)

Expand Down Expand Up @@ -501,12 +501,12 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package,_one_uncalled_vulnerability,_and_one_called_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
GHSA-123: Something scarier! (https://osv.dev/GHSA-123)

1 uncalled vulnerability found in path/to/my/first/lockfile
Expand All @@ -516,7 +516,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_one_called_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -526,7 +526,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_one_uncalled_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 uncalled vulnerability found in path/to/my/first/lockfile
Expand All @@ -536,7 +536,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_one_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -546,7 +546,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_one_vulnerability_(dev) - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -556,7 +556,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_two_aliases_of_a_single_uncalled_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 may be affected by the following vulnerabilities:
mine1@1.2.3 has the following uncalled vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)
GHSA-123: Something scary! (https://osv.dev/GHSA-123)

Expand All @@ -567,7 +567,7 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_one_package_and_two_aliases_of_a_single_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)
GHSA-123: Something scary! (https://osv.dev/GHSA-123)

Expand All @@ -578,9 +578,9 @@ path/to/my/first/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/one_source_with_vulnerabilities,_some_missing_content - 1]
path/to/my/first/lockfile: found 2 packages with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: This vulnerability allows for some very scary stuff to happen - seriously,... (https://osv.dev/OSV-1)
mine3@0.10.2-rc is affected by the following vulnerabilities:
mine3@0.10.2-rc has the following known vulnerabilities:
OSV-2: (no details available) (https://osv.dev/OSV-2)

2 known vulnerabilities found in path/to/my/first/lockfile
Expand All @@ -590,7 +590,7 @@ path/to/my/first/lockfile: found 2 packages with issues
[TestPrintVerticalResults_WithVulnerabilities/two_sources_with_packages,_one_vulnerability - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile
Expand All @@ -603,14 +603,14 @@ path/to/my/second/lockfile: found 1 package with issues
[TestPrintVerticalResults_WithVulnerabilities/two_sources_with_the_same_vulnerable_package - 1]
path/to/my/first/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/first/lockfile

path/to/my/second/lockfile: found 1 package with issues

mine1@1.2.3 is affected by the following vulnerabilities:
mine1@1.2.3 has the following known vulnerabilities:
OSV-1: Something scary! (https://osv.dev/OSV-1)

1 known vulnerability found in path/to/my/second/lockfile
Expand Down
8 changes: 4 additions & 4 deletions internal/output/vertical.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ func printVerticalVulnerabilitiesForPackages(result models.PackageSource, out io
continue
}

state := "is"
if !printingCalled {
state = "may be"
state := "uncalled"
if printingCalled {
state = "known"
}

fmt.Fprintf(out,
" %s %s\n",
text.FgYellow.Sprintf("%s@%s", pkg.Package.Name, pkg.Package.Version),
text.FgRed.Sprintf("%s affected by the following vulnerabilities:", state),
text.FgRed.Sprintf("has the following %s vulnerabilities:", state),
)

for _, vulnerability := range vulns {
Expand Down

0 comments on commit 347ca61

Please sign in to comment.