commit

package
v0.6.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package commit contains code for reading and processing commits.

Index

Constants

View Source
const DefaultTagTemplate = `{{- with $scope := .Version.Scope -}}
{{- $scope -}}/
{{- end -}}
v{{- semver .Version -}}`

Variables

View Source
var ErrNoTags = errors.New("commit: no release tags found")

Functions

This section is empty.

Types

type AnalyzedCommit

type AnalyzedCommit struct {
	*model.Commit
	ReleaseType ReleaseType
	Scope       string
	CommitType  string
	Policy      *config.Policy
	// Valid, when false, indicates that the commit didn't match any policies,
	// but there was a fallback.
	Valid       bool
	Annotations []BodyAnnotation
}

type AnalyzedCommits added in v0.6.3

type AnalyzedCommits []*AnalyzedCommit

func (AnalyzedCommits) TextSummary added in v0.6.3

func (acs AnalyzedCommits) TextSummary(w io.Writer) error

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

func NewAnalyzer

func NewAnalyzer(cfg config.Config, vcs vcs.Interface, tag *Tag) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, rc string) ([]*Version, error)

func (*Analyzer) AnalyzeScope

func (a *Analyzer) AnalyzeScope(ctx context.Context, scope, rc string) (*Version, error)

func (*Analyzer) LatestRelease added in v0.6.0

func (a *Analyzer) LatestRelease(ctx context.Context, scope, rc string) (semver.Version, error)

func (*Analyzer) Match added in v0.6.0

func (a *Analyzer) Match(commit *model.Commit, policies []*config.Policy) (*AnalyzedCommit, error)

func (*Analyzer) ReadCommitsSince added in v0.6.0

func (a *Analyzer) ReadCommitsSince(ctx context.Context, scope string, latest semver.Version) ([]*model.Commit, error)

type BodyAnnotation

type BodyAnnotation struct {
	Name string
	Body string
}

type NoMatchingPolicyError added in v0.6.7

type NoMatchingPolicyError struct {
	Policies []string
}

func (NoMatchingPolicyError) Error added in v0.6.7

func (e NoMatchingPolicyError) Error() string

func (NoMatchingPolicyError) Is added in v0.6.7

func (e NoMatchingPolicyError) Is(other error) bool

type ReleaseType

type ReleaseType int
const (
	ReleaseSkip ReleaseType
	ReleasePatch
	ReleaseMinor
	ReleaseMajor
)

func ReleaseTypeFromString

func ReleaseTypeFromString(s string) ReleaseType

func (ReleaseType) String

func (t ReleaseType) String() string

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

func NewTag

func NewTag(s string) (*Tag, error)

func (*Tag) Execute

func (t *Tag) Execute(w io.Writer, d TagData) error

func (*Tag) ExecuteString

func (t *Tag) ExecuteString(d TagData) (string, error)

func (*Tag) ExtractSemver

func (t *Tag) ExtractSemver(scope, rc, tag string) (semver.Version, error)

func (*Tag) Glob

func (t *Tag) Glob(scope, rc string) (string, error)

func (*Tag) GlobVersion

func (t *Tag) GlobVersion(scope, rc string, v semver.Version) (string, error)

func (*Tag) Prefix

func (t *Tag) Prefix(scope string) (string, error)

func (*Tag) SemverLatest

func (t *Tag) SemverLatest(tags []string, scope, rc string) (semver.Version, error)

type TagData

type TagData struct {
	Version *Version
}

type Version

type Version struct {
	semver.Version
	Scope      string            `json:"scope,omitempty"`
	AllCommits []*AnalyzedCommit `json:"all_commits"`
	Commit     string            `json:"commit"`
	RC         string
	// contains filtered or unexported fields
}

func (*Version) Pre

func (v *Version) Pre() []string

func (*Version) ScopedCommits added in v0.6.10

func (v *Version) ScopedCommits() []*AnalyzedCommit

func (*Version) ShortCommit

func (v *Version) ShortCommit() string

func (*Version) String

func (v *Version) String() string

func (*Version) V

func (v *Version) V() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL