commit

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package commit contains code for reading and processing commits.

Index

Constants

View Source
const DefaultTagTemplate = `` /* 152-byte string literal not displayed */

Variables

View Source
var ErrNoPolicy = errors.New("commit: no policy matched")
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
	Policy      *config.Policy
	Valid       bool
	Annotations []BodyAnnotation
}

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)

type BodyAnnotation

type BodyAnnotation struct {
	Name string
	Body string
}

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) 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