Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrNoCommitsSinceTag = "no commits since last tag" ErrNoVCSDetected = "not in a version control repository" ErrNoBumpDetected = "no version bump detected in commits" )
Error messages
View Source
const ( LogCommitsAnalyzed = "commits_analyzed" LogBumpLevelDetected = "bump_level_detected" LogSkipDetected = "skip_detected" )
Log messages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BumpLevel ¶
type BumpLevel int
BumpLevel represents the detected version bump level
func (BumpLevel) ToVersionLevel ¶
func (b BumpLevel) ToVersionLevel() version.VersionLevel
ToVersionLevel converts BumpLevel to version.VersionLevel Returns -1 for BumpNone and BumpSkip (no version change)
type CommitAnalysis ¶
type CommitAnalysis struct {
BumpLevel BumpLevel // Final determined bump level
Commits []ParsedCommit // All parsed commits
SkipReason string // If skip, why
TriggeringCommit string // The commit that determined the bump level
CommitCount int // Total commits analyzed
}
CommitAnalysis contains the result of analyzing multiple commits
type ParseMode ¶
type ParseMode int
ParseMode controls which commit formats to recognize
const ( ModeSemverMarkers ParseMode = 1 << iota // +semver: markers only ModeConventionalCommits // Conventional commits only ModeAll = ModeSemverMarkers | ModeConventionalCommits )
type ParsedCommit ¶
type ParsedCommit struct {
Message string // Original commit message
BumpLevel BumpLevel // Detected bump level
Format string // "semver-marker", "conventional", or "unknown"
Type string // For conventional: "feat", "fix", etc.
Scope string // For conventional: optional scope in parentheses
IsBreaking bool // Whether this is a breaking change
}
ParsedCommit represents a single parsed commit
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles commit message parsing
func (*Parser) AnalyzeCommits ¶
func (p *Parser) AnalyzeCommits(messages []string) CommitAnalysis
AnalyzeCommits analyzes multiple commits and determines the bump level Conflict resolution:
- Highest level wins (major > minor > patch > none)
- Exception: if ANY commit has +semver:skip, return skip
func (*Parser) ParseCommit ¶
func (p *Parser) ParseCommit(message string) ParsedCommit
ParseCommit parses a single commit message and detects bump level
Click to show internal directories.
Click to hide internal directories.