state

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(language LangPack, typeStr string)

Init ...

Types

type LangPack

type LangPack interface {
	GetHint(state State, v ...interface{}) string
	GetRule(types string) string
}

type State

type State int8

State indicate the state of a commit message

const (
	// normal state
	Validated State = iota
	Merge
	// non format error
	ArgumentMissing
	FileMissing
	ReadError
	// format error
	EmptyMessage
	EmptyHeader
	BadHeaderFormat
	WrongType
	ScopeMissing
	WrongScope
	BodyMissing
	NoBlankLineBeforeBody
	LineOverLong
	UndefindedError
)

message states

func (State) IsFormatError

func (state State) IsFormatError() bool

IsFormatError return if the state a format error

func (State) IsNormal

func (state State) IsNormal() bool

IsNormal return if the state a normal state

func (State) LogAndExit

func (state State) LogAndExit(v ...interface{})

LogAndExit ...

func (State) MarshalText added in v0.3.0

func (state State) MarshalText() (text []byte, err error)

func (State) String added in v0.3.0

func (i State) String() string

func (*State) UnmarshalText added in v0.3.0

func (state *State) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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