Skip to content

Commit

Permalink
feat(osv-linter): add stubs for all current defined ecosystems (#315)
Browse files Browse the repository at this point in the history
Adds Red Hat and SUSE/openSUSE and sorts consistent with case
insensitive sort of OSV.dev's `ecosystems.txt`

Signed-off-by: Andrew Pollock <apollock@google.com>
  • Loading branch information
andrewpollock authored Nov 27, 2024
1 parent eaaf65a commit c44c784
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tools/osv-linter/internal/pkgchecker/ecosystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var SupportedEcosystems = []string{
// Dispatcher for ecosystem-specific package existence checking.
func ExistsInEcosystem(pkg string, ecosystem string) bool {
switch ecosystem {
case "Alpine":
return true
case "AlmaLinux":
return true
case "Alpine":
return true
case "Android":
return true
case "Bitnami":
Expand Down Expand Up @@ -63,6 +63,8 @@ func ExistsInEcosystem(pkg string, ecosystem string) bool {
return true
case "NuGet":
return true
case "openSUSE":
return true
case "OSS-Fuzz":
return true
case "Packagist":
Expand All @@ -71,10 +73,14 @@ func ExistsInEcosystem(pkg string, ecosystem string) bool {
return true
case "PyPI":
return existsInPyPI(pkg)
case "Red Hat":
return true
case "Rocky Linux":
return true
case "RubyGems":
return true
case "SUSE":
return true
case "SwiftURL":
return true
case "Ubuntu":
Expand Down Expand Up @@ -102,10 +108,10 @@ func (e *MissingVersionsError) Error() string {
// Dispatcher for ecosystem-specific package version existence checking.
func VersionsExistInEcosystem(pkg string, versions []string, ecosystem string) error {
switch ecosystem {
case "Alpine":
return nil
case "AlmaLinux":
return nil
case "Alpine":
return nil
case "Android":
return nil
case "Bitnami":
Expand Down Expand Up @@ -138,6 +144,8 @@ func VersionsExistInEcosystem(pkg string, versions []string, ecosystem string) e
return nil
case "NuGet":
return nil
case "openSUSE":
return nil
case "OSS-Fuzz":
return nil
case "Packagist":
Expand All @@ -146,10 +154,14 @@ func VersionsExistInEcosystem(pkg string, versions []string, ecosystem string) e
return nil
case "PyPI":
return versionsExistInPyPI(pkg, versions)
case "Red Hat":
return nil
case "Rocky Linux":
return nil
case "RubyGems":
return nil
case "SUSE":
return nil
case "SwiftURL":
return nil
case "Ubuntu":
Expand Down

0 comments on commit c44c784

Please sign in to comment.