semver

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BumpOptions

type BumpOptions struct {
	Config  config.Uplift
	DryRun  bool
	Verbose bool
}

BumpOptions configures the behaviour when bumping a semantic version

type Bumper

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

Bumper is capable of bumping a semantic version associated with a git repository based on the conventional commits standard: @see https://www.conventionalcommits.org/en/v1.0.0/

func NewBumper

func NewBumper(out io.Writer, opts BumpOptions) Bumper

NewBumper initialises a new semantic version bumper

func (Bumper) Bump

func (b Bumper) Bump() error

Bump a semantic version based on the latest git log message within the associated git repository. Versions are incremented using the conventional commits standard. Once a version has been bumped, it will be tagged against the latest commit

type FileBump added in v0.2.0

type FileBump struct {
	Regex   string
	Version string
	Count   int
	SemVer  bool
}

FileBump defines how a version within a file will be matched through a regex and bumped using the provided version

type Increment

type Increment string

Increment defines the different types of increment that can be performed against a semantic version

const (
	// NoIncrement represents no increment change to a semantic version
	NoIncrement Increment = "None"
	// PatchIncrement represents a patch increment (1.0.x) to a semantic version
	PatchIncrement Increment = "Patch"
	// MinorIncrement represents a minor increment (1.x.0) to a semantic version
	MinorIncrement Increment = "Minor"
	// MajorIncrement represents a major increment (x.0.0) to a semantic version
	MajorIncrement Increment = "Major"
)

func ParseCommit

func ParseCommit(commit string) Increment

ParseCommit will identify the type of increment to perform by parsing the commit message against the conventional commit standards defined, @see: https://www.conventionalcommits.org/en/v1.0.0/

Jump to

Keyboard shortcuts

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