commit

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Type     string
	Scope    string
	Subject  string
	Body     string
	Breaking bool
	Header   string
	Footers  []Footer
	Merge    bool
	Revert   Revert
}

Commit represents the parsed data from a conventional commit message.

func Parse

func Parse(s string) (c Commit)

Parse parses a commit message and returns a conventional commit.

If the message does not follow the format, then nil is returned.

func (Commit) Message

func (c Commit) Message() string
type Footer struct {
	Title string
	Text  string
}

Footer represents a conventional commit footer, which roughly corresponds to a git trailer: Foo-bar: some text.

func (Footer) String

func (f Footer) String() string

type Revert

type Revert struct {
	Header string
	Hash   string
}

Revert represents what this commmit reverts.

Jump to

Keyboard shortcuts

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