program

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypesInOrder = Types{
	"feat",
	"fix",
	"test",
	"docs",
	"build",
	"refactor",
	"chore",
}
View Source
var Version = "unknown"

Functions

This section is empty.

Types

type ChangeSet

type ChangeSet struct {
	BreakingChanges []string
	Commits         map[TypeTag][]string
}

func NewChangeset

func NewChangeset() *ChangeSet

func (*ChangeSet) AddBreaking

func (c *ChangeSet) AddBreaking(message string)

func (*ChangeSet) AddCommit

func (c *ChangeSet) AddCommit(tt TypeTag, section string, message string)

type Changelog

type Changelog struct {
	Path                   string    `default:"." short:"p" help:"Path for the git worktree/repo to log"`
	SinceTag               string    `short:"s" help:"Tag from which to start" aliases:"since"`
	DefaultType            TypeTag   `default:"fix" help:"if type is not specified in commit, assume this type"`
	GuessMissingCommitType bool      `default:"true" negatable:"" help:"If commit type is missing, take a guess about which it is"`
	Order                  []TypeTag `default:"${type_order}" help:"order in which to list commit message types"`
}

func (*Changelog) CalculateChanges

func (c *Changelog) CalculateChanges() (*ChangeSet, error)

func (*Changelog) Run

func (c *Changelog) Run() error

type CommitEntry

type CommitEntry struct {
	Name     string
	Tag      TypeTag
	Order    int
	Messages []string
}

type Options

type Options struct {
	Debug      bool       `short:"d" help:"Show debugging information"`
	LogFormat  string     `short:"l" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet      bool       `short:"q" help:"Be less verbose than usual"`
	Changelog  Changelog  `cmd:""`
	VersionCmd VersionCmd `name:"version" cmd:"" help:"show program version"`
	Semver     Semver     `cmd:"" help:"Manipulate Semantic Versions"`
}

Options is the structure of program options

func (*Options) Init

func (program *Options) Init()

func (*Options) Run

func (program *Options) Run() error

Run runs the program

type Semver

type Semver struct {
	Changelog
	FromTag        bool     `group:"source" xor:"source" required:"" help:"Set semver from the last tag" `
	FromFile       string   `` /* 144-byte string literal not displayed */
	ReplaceIn      []string `type:"existingfile" placeholder:"FILE" help:"Replace version in these files"`
	AllowUntracked bool     `help:"allow untracked files to count as clean"`
}

func (*Semver) FindPreviousVersion

func (s *Semver) FindPreviousVersion(r *git.Repository) (semver.Version, string, error)

func (*Semver) FindPreviousVersionFromFile

func (s *Semver) FindPreviousVersionFromFile() (semver.Version, string, error)

func (*Semver) FindPreviousVersionFromTag

func (s *Semver) FindPreviousVersionFromTag(r *git.Repository) (version semver.Version, foundTag string, errReturn error)

func (*Semver) ReplaceInFile

func (s *Semver) ReplaceInFile(filename string, new string) error

func (*Semver) Run

func (s *Semver) Run() error

type TypeTag

type TypeTag string

type Types

type Types []TypeTag

func (Types) Join

func (t Types) Join(sep string) string

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (v *VersionCmd) Run() error

Jump to

Keyboard shortcuts

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