< Summary - go-semantic-release Coverage

Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 48
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ReleaseType0%00100%

File(s)

/home/runner/work/go-semantic-release/go-semantic-release/internal/domain/commit.go

#LineLine coverage
 1package domain
 2
 3import "time"
 4
 5// Commit represents a parsed git commit with conventional commit metadata.
 6type Commit struct {
 7  Hash             string
 8  Message          string
 9  Author           string
 10  AuthorEmail      string
 11  Date             time.Time
 12  Type             string // e.g. "feat", "fix", "chore"
 13  Scope            string
 14  Description      string
 15  Body             string
 16  Footer           string
 17  IsBreakingChange bool
 18  BreakingNote     string
 19  FilesChanged     []string
 20}
 21
 22// ReleaseType returns the release type implied by this commit.
 723func (c Commit) ReleaseType(typeMapping map[string]ReleaseType) ReleaseType {
 124  if c.IsBreakingChange {
 125    return ReleaseMajor
 126  }
 527  if rt, ok := typeMapping[c.Type]; ok {
 528    return rt
 529  }
 130  return ReleaseNone
 31}
 32
 33// DefaultCommitTypeMapping returns the standard mapping from conventional commit types to release types.
 34func DefaultCommitTypeMapping() map[string]ReleaseType {
 35  return map[string]ReleaseType{
 36    "feat":     ReleaseMinor,
 37    "fix":      ReleasePatch,
 38    "perf":     ReleasePatch,
 39    "revert":   ReleasePatch,
 40    "refactor": ReleaseNone,
 41    "docs":     ReleaseNone,
 42    "style":    ReleaseNone,
 43    "test":     ReleaseNone,
 44    "build":    ReleaseNone,
 45    "ci":       ReleaseNone,
 46    "chore":    ReleaseNone,
 47  }
 48}

Methods/Properties

ReleaseType