Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConventionalCommit ¶
type ConventionalCommit struct {
// Type is the type of change (e.g., "feat", "fix", "docs").
Type string `yaml:"type" json:"type"`
// Subject is the short summary of the change.
Subject string `yaml:"subject" json:"subject"`
// Body is the long-form description of the change.
Body string `yaml:"body" json:"body"`
// LibraryID is the library ID the commit associated with.
LibraryID string `yaml:"-" json:"-"`
// Scope is the scope of the change.
Scope string `yaml:"-" json:"-"`
Footers map[string]string `yaml:"-" json:"-"`
// IsBreaking indicates if the commit introduces a breaking change.
IsBreaking bool `yaml:"-" json:"-"`
// IsNested indicates if the commit is a nested commit.
IsNested bool `yaml:"-" json:"-"`
// SHA is the full commit hash.
// Deprecated: use CommitHash instead.
SHA string `yaml:"-" json:"source_commit_hash,omitempty"`
// CommitHash is the full commit hash.
CommitHash string `yaml:"-" json:"commit_hash,omitempty"`
// When is the timestamp of the commit.
When time.Time `yaml:"-" json:"-"`
}
ConventionalCommit represents a parsed conventional commit message. See https://www.conventionalcommits.org/en/v1.0.0/ for details.
func ParseCommits ¶
func ParseCommits(commit *gitrepo.Commit, libraryID string) ([]*ConventionalCommit, error)
ParseCommits parses a commit message into a slice of ConventionalCommit structs.
It supports an override block wrapped in BEGIN_COMMIT_OVERRIDE and END_COMMIT_OVERRIDE. If found, this block takes precedence, and only its content will be parsed.
The message can also contain multiple nested commits, each wrapped in BEGIN_NESTED_COMMIT and END_NESTED_COMMIT markers.
Malformed override or nested blocks (e.g., with a missing end marker) are ignored. Any commit part that is found but fails to parse as a valid conventional commit is logged and skipped.
func (*ConventionalCommit) MarshalJSON ¶
func (c *ConventionalCommit) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom JSON marshaler for ConventionalCommit.