{"modulePath":"github.com/benjaminabbitt/versionator","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package commitparser\n\n## Constants\n\n```go\nconst (\n\tErrNoCommitsSinceTag = \"no commits since last tag\"\n\tErrNoVCSDetected     = \"not in a version control repository\"\n\tErrNoBumpDetected    = \"no version bump detected in commits\"\n)\n```\nError messages\n\n```go\nconst (\n\tLogCommitsAnalyzed   = \"commits_analyzed\"\n\tLogBumpLevelDetected = \"bump_level_detected\"\n\tLogSkipDetected      = \"skip_detected\"\n)\n```\nLog messages\n\n## Types\n\n```go\ntype BumpLevel int\n```\nBumpLevel represents the detected version bump level\n\n```go\nconst (\n\tBumpNone  BumpLevel = iota // No bump detected\n\tBumpPatch                  // Patch bump (fix:, +semver:patch)\n\tBumpMinor                  // Minor bump (feat:, +semver:minor)\n\tBumpMajor                  // Major bump (BREAKING CHANGE, !, +semver:major)\n\tBumpSkip                   // Explicitly skip versioning (+semver:skip)\n)\n```\n\n```go\nfunc (b BumpLevel) String() string\n```\nString returns the string representation of a BumpLevel\n\n```go\nfunc (b BumpLevel) ToVersionLevel() version.VersionLevel\n```\nToVersionLevel converts BumpLevel to version.VersionLevel Returns -1 for BumpNone and BumpSkip (no version change)\n\n```go\ntype CommitAnalysis struct {\n\tBumpLevel        BumpLevel      // Final determined bump level\n\tCommits          []ParsedCommit // All parsed commits\n\tSkipReason       string         // If skip, why\n\tTriggeringCommit string         // The commit that determined the bump level\n\tCommitCount      int            // Total commits analyzed\n}\n```\nCommitAnalysis contains the result of analyzing multiple commits\n\n```go\ntype ParseMode int\n```\nParseMode controls which commit formats to recognize\n\n```go\nconst (\n\tModeSemverMarkers       ParseMode = 1 \u003c\u003c iota // +semver: markers only\n\tModeConventionalCommits                       // Conventional commits only\n\tModeAll                 = ModeSemverMarkers | ModeConventionalCommits\n)\n```\n\n```go\ntype ParsedCommit struct {\n\tMessage    string    // Original commit message\n\tBumpLevel  BumpLevel // Detected bump level\n\tFormat     string    // \"semver-marker\", \"conventional\", or \"unknown\"\n\tType       string    // For conventional: \"feat\", \"fix\", etc.\n\tScope      string    // For conventional: optional scope in parentheses\n\tIsBreaking bool      // Whether this is a breaking change\n}\n```\nParsedCommit represents a single parsed commit\n\n```go\ntype Parser struct {\n\t// contains filtered or unexported fields\n}\n```\nParser handles commit message parsing\n\n```go\nfunc NewParser(mode ParseMode) *Parser\n```\nNewParser creates a parser with the specified mode\n\n```go\nfunc (p *Parser) AnalyzeCommits(messages []string) CommitAnalysis\n```\nAnalyzeCommits analyzes multiple commits and determines the bump level Conflict resolution:\n\n  - Highest level wins (major \u003e minor \u003e patch \u003e none)\n  - Exception: if ANY commit has +semver:skip, return skip\n\n```go\nfunc (p *Parser) ParseCommit(message string) ParsedCommit\n```\nParseCommit parses a single commit message and detects bump level\n\n","path":"github.com/benjaminabbitt/versionator/internal/commitparser","name":"commitparser","synopsis":"","isRedistributable":true}
