Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexport types and functions cataloger packages #2530

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

wagoodman
Copy link
Contributor

This PR attempts to reduce the surface area of functions and types exported from the syft/pkg/cataloger/** packages.

This additionally adds an integration test to ensure that catalogers added are following conventions:

  • Cataloger constructor functions should follow the glob New*Cataloger
  • Config structs must be named *Config and must be paired with a zero parameter function called Default*Config

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman added this to the Syft 1.0 milestone Jan 22, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review January 22, 2024 22:30
@wagoodman wagoodman requested a review from a team January 22, 2024 22:30
@wagoodman wagoodman self-assigned this Jan 22, 2024
@wagoodman wagoodman added the breaking-change Change is not backwards compatible label Jan 22, 2024
@wagoodman wagoodman enabled auto-merge (squash) January 23, 2024 00:15
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 11c0b1c into main Jan 24, 2024
11 checks passed
@wagoodman wagoodman deleted the unexport-cataloger-structs branch January 24, 2024 21:12
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
* unexport as many types and functions from cataloger packages as possible

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

* capture type and signature information in convention test

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

* check that we return pkg.Cataloger from constructors

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

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Change is not backwards compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants