commitparser

package
v0.0.0-...-ea07d1b Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrailerKeyBreakingChangePrefix = "BREAKING"
	TrailerKeyBreakingChange       = TrailerKeyBreakingChangePrefix + " CHANGE"
	TrailerKeyBreakingChangeAlt    = TrailerKeyBreakingChangePrefix + "-CHANGE"
)

Variables

View Source
var (
	ErrInvalidType    = errors.New("invalid commit type")
	ErrInvalidScope   = errors.New("invalid commit scope")
	ErrInvalidSubject = errors.New("invalid commit subject")
	ErrInvalidMessage = errors.New("invalid commit message")
	ErrInvalidTrailer = errors.New("invalid trailer in commit message")
)

Functions

This section is empty.

Types

type CommitMessage

type CommitMessage struct {
	Type     string
	Scope    string
	Subject  string
	Body     string
	Trailers []Trailer
	Breaking bool
	Revert   bool
	Merge    bool
}

func Parse

func Parse(message string) (CommitMessage, error)

type ParseError

type ParseError struct {
	Pos int
	// contains filtered or unexported fields
}

func (ParseError) Error

func (err ParseError) Error() string

func (ParseError) Unwrap

func (err ParseError) Unwrap() error

type Trailer

type Trailer struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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