nsv

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoMatch = Match{Index: noMatchIdx}
)

Functions

func CheckTemplate

func CheckTemplate(tmpl string) error

func DetectCommand

func DetectCommand(log []git.LogEntry) (Command, Match)

func TemplateFields

func TemplateFields() map[string]struct{}

func TokenizeFields

func TokenizeFields(data []byte, atEOF bool) (advance int, token []byte, err error)

Types

type Command

type Command struct {
	Force      Increment
	Prerelease string
}

type ConventionalStrategy added in v0.8.0

type ConventionalStrategy struct {
	MajorPrefixes []string
	MinorPrefixes []string
	PatchPrefixes []string
}

func Angular added in v0.8.0

func Angular() ConventionalStrategy

func AngularMerge added in v0.8.0

func AngularMerge(major, minor, patch []string) ConventionalStrategy

func (ConventionalStrategy) DetectIncrement added in v0.8.0

func (s ConventionalStrategy) DetectIncrement(log []git.LogEntry) (Increment, Match)

type DevNull added in v0.9.0

type DevNull struct{}

func (DevNull) Close added in v0.9.0

func (DevNull) Close() error

func (DevNull) Read added in v0.9.0

func (DevNull) Read(_ []byte) (int, error)

func (DevNull) Write added in v0.9.0

func (DevNull) Write(p []byte) (int, error)

type Increment

type Increment int
const (
	NoIncrement Increment = iota
	PatchIncrement
	MinorIncrement
	MajorIncrement
)

func (Increment) String added in v0.8.0

func (i Increment) String() string

type Match added in v0.4.0

type Match struct {
	End   int
	Index int
	Start int
}

type Next added in v0.4.0

type Next struct {
	Diffs   []git.FileDiff
	Log     []git.LogEntry
	LogDir  string
	Match   Match
	PrevTag string
	Tag     string
}

func NextVersion

func NextVersion(gitc *git.Client, opts Options) (*Next, error)

type Options

type Options struct {
	Hook          string
	Logger        *log.Logger
	MajorPrefixes []string
	MinorPrefixes []string
	PatchPrefixes []string
	Path          string
	VersionFormat string
}

type Tag

type Tag struct {
	Prefix   string
	SemVer   string
	Version  string
	Raw      string
	Pre      string
	Metadata string
}

func ParseTag

func ParseTag(raw string) (Tag, error)

func (Tag) Bump

func (t Tag) Bump(semv string) Tag

func (Tag) Format

func (t Tag) Format(format string) string

func (Tag) Prerelease added in v0.7.0

func (t Tag) Prerelease() bool

func (Tag) PrereleaseWithLabel added in v0.7.0

func (t Tag) PrereleaseWithLabel(label string) bool

type UnknownTemplateFieldError

type UnknownTemplateFieldError struct {
	Field string
}

func (UnknownTemplateFieldError) Error

Jump to

Keyboard shortcuts

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