Add a homebrew cataloger (#3724)

* Cataloger homebrew (#4)

* homebrew cataloger

* uptd

* fixed test

* fixed test

* fixed tests

* fixed lint

* inc schema ver

* upt schema

* fixed integration test

* fixed integration tst

* fixed test

Signed-off-by: Rez Moss <hi@rezmoss.com>

* Update parse_homebrew_test.go

Signed-off-by: Rez Moss <hi@rezmoss.com>

* Update parse_homebrew_test.go

fixed DCO

Signed-off-by: Rez Moss <hi@rezmoss.com>



Signed-off-by: Rez Moss <hi@rezmoss.com>

* Update parse_homebrew_test.go

add evd anno to test

Signed-off-by: Rez Moss <hi@rezmoss.com>

* lint

Signed-off-by: Rez Moss <hi@rezmoss.com>

* fixed test

Signed-off-by: Rez Moss <hi@rezmoss.com>

* with PR refactors

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* regenerate json schema

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* fix tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* regenerate jsonschema

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* refactor homebrew parser + add tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* more resiliant variable extraction

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Rez Moss <hi@rezmoss.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Rez Moss
2025-05-13 13:01:41 -04:00
committed by GitHub
co-authored by Alex Goodman
parent de88b973f8
commit 12d91f47dc
26 changed files with 4263 additions and 4 deletions
+6
View File
@@ -48,6 +48,7 @@ const (
SwiplPackPkg Type = "swiplpack"
TerraformPkg Type = "terraform"
WordpressPluginPkg Type = "wordpress-plugin"
HomebrewPkg Type = "homebrew"
)
// AllPkgs represents all supported package types
@@ -90,6 +91,7 @@ var AllPkgs = []Type{
SwiplPackPkg,
TerraformPkg,
WordpressPluginPkg,
HomebrewPkg,
}
// PackageURLType returns the PURL package type for the current package.
@@ -162,6 +164,8 @@ func (t Type) PackageURLType() string {
return "terraform"
case WordpressPluginPkg:
return "wordpress-plugin"
case HomebrewPkg:
return "homebrew"
default:
// TODO: should this be a "generic" purl type instead?
return ""
@@ -246,6 +250,8 @@ func TypeByName(name string) Type {
return TerraformPkg
case "wordpress-plugin":
return WordpressPluginPkg
case "homebrew":
return HomebrewPkg
default:
return UnknownPkg
}