Documentation
¶
Overview ¶
Package contributors extracts, deduplicates, and formats contributor information from git history for use in changelogs, release notes, and the CONTRIBUTORS.md hall of fame.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatChangelog ¶
func FormatChangelog(contributors []Contributor) string
FormatChangelog returns a ### Contributors section for CHANGELOG.md.
func FormatContributorsMD ¶
func FormatContributorsMD(contributors []Contributor) string
FormatContributorsMD generates the full CONTRIBUTORS.md content.
func FormatReleaseNotes ¶
func FormatReleaseNotes(contributors []Contributor) string
FormatReleaseNotes returns a contributor acknowledgment section for GitHub Release notes (injected via GoReleaser footer or workflow).
func MarkFirstTimers ¶
func MarkFirstTimers(contributors []Contributor, opts Options) error
MarkFirstTimers marks contributors whose first commit to the project falls within the given range. It compares against all-time contributors extracted from the full history up to fromRef.
Types ¶
type Contributor ¶
type Contributor struct {
Name string
Email string
CommitCount int
IsFirstTime bool
FirstCommit time.Time
LatestCommit time.Time
}
Contributor represents a single project contributor.
func Extract ¶
func Extract(opts Options) ([]Contributor, error)
Extract returns contributors for the given ref range. It parses commit authors AND Co-authored-by trailers, deduplicates by email, and filters out bot accounts.
func ExtractAll ¶
func ExtractAll(opts Options) ([]Contributor, error)
ExtractAll returns all-time contributors across the full git history.
type Options ¶
type Options struct {
// RepoDir is the repository root. Defaults to "." if empty.
RepoDir string
// FromRef is the starting ref (exclusive). If empty, includes all history.
FromRef string
// ToRef is the ending ref (inclusive). Defaults to "HEAD" if empty.
ToRef string
// contains filtered or unexported fields
}
Options configures contributor extraction.