From 884c31e4526f20a40ae59c789093d3b9060b9343 Mon Sep 17 00:00:00 2001 From: Andrew Pollock Date: Wed, 27 Nov 2024 03:18:08 +0000 Subject: [PATCH] feat(osv-linter): add stubs for all current defined ecosystems Adds Red Hat and SUSE/openSUSE and sorts consistent with case insensitive sort of OSV.dev's `ecosystems.txt` Signed-off-by: Andrew Pollock --- .../internal/pkgchecker/ecosystems.go | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/osv-linter/internal/pkgchecker/ecosystems.go b/tools/osv-linter/internal/pkgchecker/ecosystems.go index 025ebbd..ed6beea 100644 --- a/tools/osv-linter/internal/pkgchecker/ecosystems.go +++ b/tools/osv-linter/internal/pkgchecker/ecosystems.go @@ -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": @@ -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": @@ -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": @@ -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": @@ -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": @@ -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":