Skip to content

Commit

Permalink
feat: docs for checker go plugins
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
pdxjohnny committed Jan 18, 2024
1 parent ea0dd90 commit 376ba3a
Show file tree
Hide file tree
Showing 3 changed files with 941 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/checks/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strings"

"github.com/ossf/scorecard/v4/docs/checks/internal"
"github.com/ossf/scorecard/v4/docs/checks/plugin"
sce "github.com/ossf/scorecard/v4/errors"
)

Expand All @@ -32,6 +33,7 @@ const docURL = "https://github.com/ossf/scorecard/blob/%s/docs/checks.md"
// contains checks' documentation.
type DocImpl struct {
internaldoc internal.Doc
plugindoc plugin.Doc
}

// Read loads the checks' documentation.
Expand All @@ -42,7 +44,13 @@ func Read() (Doc, error) {
return &d, fmt.Errorf("internal.ReadDoc: %w", e)
}

d := DocImpl{internaldoc: m}
p, e := plugin.ReadDoc()
if e != nil {
d := DocImpl{}
return &d, fmt.Errorf("plugin.ReadDoc: %w", e)
}

d := DocImpl{internaldoc: m, plugindoc: p}
return &d, nil
}

Expand Down
Loading

0 comments on commit 376ba3a

Please sign in to comment.