gitcliff

package
v0.0.0-...-4e1735e Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliffConfigName = "cliff.toml"
	Cmd             = "git-cliff"
)

Variables

This section is empty.

Functions

func BuildChangelog

func BuildChangelog(wd, chgLogFile, semVer string) ([]string, error)

BuildChangelog Update the change log file with any unreleased changes.

semVer allows you to set the tag manually

func Bump

func Bump(wd string) string

Bump Returns the next semantic version if there are unreleased changes.

This will return an empty string if there are no released changes, however
that does NOT mean the changelog is up-to-date.

func HasUnreleasedChanges

func HasUnreleasedChanges(wd string) (bool, error)

HasUnreleasedChanges Indicate there are changes in the current branch that needed to be added to the changelog and tagged.

This makes use of the --context flag to return any unreleased commit.

func NextVersion

func NextVersion(wd string) (string, error)

NextVersion Calculated semantic version.

func UnreleasedMessage

func UnreleasedMessage(wd string) ([]byte, error)

UnreleasedMessage Get unreleased commits changes without header and footer.

Types

type Unreleased

type Unreleased struct {
	Version string `json:"version"`
	Commits []struct {
		Id                  string        `json:"id"`
		Message             string        `json:"message"`
		Body                interface{}   `json:"body"`
		Footers             []interface{} `json:"footers"`
		Group               string        `json:"group"`
		BreakingDescription interface{}   `json:"breaking_description"`
		Breaking            bool          `json:"breaking"`
		Scope               interface{}   `json:"scope"`
		Links               []interface{} `json:"links"`
		Author              struct {
			Name      string `json:"name"`
			Email     string `json:"email"`
			Timestamp int    `json:"timestamp"`
		} `json:"author"`
		Committer struct {
			Name      string `json:"name"`
			Email     string `json:"email"`
			Timestamp int    `json:"timestamp"`
		} `json:"committer"`
		Conventional bool `json:"conventional"`
		MergeCommit  bool `json:"merge_commit"`
		Github       struct {
			Username    interface{}   `json:"username"`
			PrTitle     interface{}   `json:"pr_title"`
			PrNumber    interface{}   `json:"pr_number"`
			PrLabels    []interface{} `json:"pr_labels"`
			IsFirstTime bool          `json:"is_first_time"`
		} `json:"github"`
	} `json:"commits"`
	CommitId  interface{} `json:"commit_id"`
	Timestamp int         `json:"timestamp"`
	Previous  interface{} `json:"previous"`
	Github    struct {
		Contributors []interface{} `json:"contributors"`
	} `json:"github"`
}

func UnreleasedChanges

func UnreleasedChanges(wd string) ([]Unreleased, error)

UnreleasedChanges Indicate there are changes in the current branch that needed to be added to the changelog and tagged.

This makes use of the --context flag to return any unreleased commit.

Jump to

Keyboard shortcuts

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