Closed spencerschrock closed 3 weeks ago
This is still a WIP, as I'm thinking about WithChecks
, if that should be a []string
or the existing checker.CheckNameToFnMap
.
There's also some duplication that happens setting up the CheckNameToFnMap
https://github.com/ossf/scorecard/blob/6815161e15b9acaec08bc868869894dc906e3252/cron/internal/worker/main.go#L202-L207
In order to automatically create a repo client if one isn't provided, I need to be able to test the Repo type.
So my latest changes make the various clients.Repo
implementations public.
https://github.com/ossf/scorecard/blob/438f838d6cb4d59579ef3651d23603e51dc59ae9/pkg/scorecard.go#L382-L399
What kind of change does this PR introduce?
breaking change / refactor
What is the current behavior?
See #3717. Ultimately every change to the signature is another breaking change, and this breaking change hopefully stops future breaking changes.
What is the new behavior (if this is a feature change)?**
A new top level entry point:
Run
. The hope is that thepkg
package also gets renamed so it's justscorecard.Run()
instead ofpkg.RunScorecard
orpkg.Run
, but that's not the topic of this PR.This entry point takes a context and a repo to be analyzed. Everything else is optional and can be passed as a list of
WithFoo()
arguments.Which issue(s) this PR fixes
Fixes #3717
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to the
release-note
(In particular, describe what changes users might need to make in their application as a result of this pull request.)