< Summary - go-semantic-release Coverage

Information
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 36
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
Name0%00100%
AnalyzeCommits0%00100%

File(s)

/home/runner/work/go-semantic-release/go-semantic-release/internal/adapters/plugins/commit_analyzer.go

#LineLine coverage
 1package plugins
 2
 3import (
 4  "context"
 5
 6  "github.com/jedi-knights/go-semantic-release/internal/domain"
 7  "github.com/jedi-knights/go-semantic-release/internal/ports"
 8)
 9
 10// Compile-time interface compliance checks.
 11var (
 12  _ ports.Plugin               = (*CommitAnalyzerPlugin)(nil)
 13  _ ports.AnalyzeCommitsPlugin = (*CommitAnalyzerPlugin)(nil)
 14)
 15
 16// CommitAnalyzerPlugin implements AnalyzeCommitsPlugin using conventional commits.
 17type CommitAnalyzerPlugin struct {
 18  parser      ports.CommitParser
 19  typeMapping map[string]domain.ReleaseType
 20}
 21
 22// NewCommitAnalyzerPlugin creates the default commit analyzer plugin.
 23func NewCommitAnalyzerPlugin(parser ports.CommitParser, typeMapping map[string]domain.ReleaseType) *CommitAnalyzerPlugin
 24  return &CommitAnalyzerPlugin{parser: parser, typeMapping: typeMapping}
 25}
 26
 127func (p *CommitAnalyzerPlugin) Name() string { return "commit-analyzer" }
 28
 329func (p *CommitAnalyzerPlugin) AnalyzeCommits(_ context.Context, rc *domain.ReleaseContext) (domain.ReleaseType, error) 
 330  highest := domain.ReleaseNone
 331  for i := range rc.Commits {
 532    rt := rc.Commits[i].ReleaseType(p.typeMapping)
 533    highest = highest.Higher(rt)
 534  }
 335  return highest, nil
 36}

Methods/Properties

Name
AnalyzeCommits