Documentation ¶
Index ¶
- func BranchHeads(repo *gogit.Repository) (map[string]*object.Commit, error)
- func FindBranch(commit *object.Commit, repo *gogit.Repository) string
- func GenerateDiff(commit *object.Commit, fileName string) string
- type GitHubActionsPrinter
- type JSONPrinter
- type LegacyJSONCompatibleSource
- type LegacyJSONOutput
- type LegacyJSONPrinter
- type PlainPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchHeads ¶
BranchHeads creates a map of branch names to their head commit. This can be used to find if a commit is an ancestor of a branch head.
func FindBranch ¶
func FindBranch(commit *object.Commit, repo *gogit.Repository) string
FindBranch returns the first branch a commit is a part of. Not the most accurate, but it should work similar to pre v3.0.
Types ¶
type GitHubActionsPrinter ¶ added in v3.46.0
type GitHubActionsPrinter struct {
// contains filtered or unexported fields
}
GitHubActionsPrinter is a printer that prints results in GitHub Actions format.
func (*GitHubActionsPrinter) Print ¶ added in v3.46.0
func (p *GitHubActionsPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata) error
type JSONPrinter ¶ added in v3.46.0
type JSONPrinter struct {
// contains filtered or unexported fields
}
JSONPrinter is a printer that prints results in JSON format.
func (*JSONPrinter) Print ¶ added in v3.46.0
func (p *JSONPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata) error
type LegacyJSONOutput ¶
type LegacyJSONOutput struct { Branch string `json:"branch"` Commit string `json:"commit"` CommitHash string `json:"commitHash"` Date string `json:"date"` Diff string `json:"diff"` Path string `json:"path"` PrintDiff string `json:"printDiff"` Reason string `json:"reason"` StringsFound []string `json:"stringsFound"` }
type LegacyJSONPrinter ¶ added in v3.46.0
type LegacyJSONPrinter struct {
// contains filtered or unexported fields
}
LegacyJSONPrinter is a printer that prints results in legacy JSON format for backwards compatibility.
func (*LegacyJSONPrinter) Print ¶ added in v3.46.0
func (p *LegacyJSONPrinter) Print(ctx context.Context, r *detectors.ResultWithMetadata) error
type PlainPrinter ¶ added in v3.46.0
type PlainPrinter struct {
// contains filtered or unexported fields
}
PlainPrinter is a printer that prints results in plain text format.
func (*PlainPrinter) Print ¶ added in v3.46.0
func (p *PlainPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata) error
Click to show internal directories.
Click to hide internal directories.