rules

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTitleMaxLength = 72
)

Variables

This section is empty.

Functions

func HighlightRed

func HighlightRed(in string) string

Types

type Rule

type Rule interface {
	Validate(commit *object.Commit) (bool, string)
	BreakWhenInvalid() bool
}

type RuleBaseFormVerb

type RuleBaseFormVerb struct {
}

func (*RuleBaseFormVerb) BreakWhenInvalid

func (r *RuleBaseFormVerb) BreakWhenInvalid() bool

func (*RuleBaseFormVerb) Suggestion

func (r *RuleBaseFormVerb) Suggestion(rs RuleSuggestion) string

func (*RuleBaseFormVerb) Validate

func (r *RuleBaseFormVerb) Validate(commit *object.Commit) (bool, string)

type RuleCapitalizedWord

type RuleCapitalizedWord struct {
}

func (*RuleCapitalizedWord) BreakWhenInvalid

func (r *RuleCapitalizedWord) BreakWhenInvalid() bool

func (*RuleCapitalizedWord) Suggestion

func (r *RuleCapitalizedWord) Suggestion(rs RuleSuggestion) string

func (*RuleCapitalizedWord) Validate

func (r *RuleCapitalizedWord) Validate(commit *object.Commit) (bool, string)

type RuleImperativeMood

type RuleImperativeMood struct {
	Prepositions []string
}

func (*RuleImperativeMood) BreakWhenInvalid

func (r *RuleImperativeMood) BreakWhenInvalid() bool

func (*RuleImperativeMood) Suggestion

func (r *RuleImperativeMood) Suggestion(rs RuleSuggestion) string

func (*RuleImperativeMood) Validate

func (r *RuleImperativeMood) Validate(commit *object.Commit) (bool, string)

type RuleKnownVerb

type RuleKnownVerb struct {
	KnownVerbs []string
}

func (*RuleKnownVerb) BreakWhenInvalid

func (r *RuleKnownVerb) BreakWhenInvalid() bool

func (*RuleKnownVerb) Suggestion

func (r *RuleKnownVerb) Suggestion(rs ruleKnownVerbSuggestion) string

func (*RuleKnownVerb) Validate

func (r *RuleKnownVerb) Validate(commit *object.Commit) (bool, string)

type RuleNoConventionalSpec

type RuleNoConventionalSpec struct {
}

func (*RuleNoConventionalSpec) BreakWhenInvalid

func (r *RuleNoConventionalSpec) BreakWhenInvalid() bool

func (*RuleNoConventionalSpec) Suggestion

func (r *RuleNoConventionalSpec) Suggestion(rs RuleSuggestion) string

func (*RuleNoConventionalSpec) Validate

func (r *RuleNoConventionalSpec) Validate(commit *object.Commit) (bool, string)

type RuleNoFixup

type RuleNoFixup struct {
}

func (*RuleNoFixup) BreakWhenInvalid

func (r *RuleNoFixup) BreakWhenInvalid() bool

func (*RuleNoFixup) Suggestion

func (r *RuleNoFixup) Suggestion(rs RuleSuggestion) string

func (*RuleNoFixup) Validate

func (r *RuleNoFixup) Validate(commit *object.Commit) (bool, string)

type RuleNoIssueNumber

type RuleNoIssueNumber struct {
}

func (*RuleNoIssueNumber) BreakWhenInvalid

func (r *RuleNoIssueNumber) BreakWhenInvalid() bool

func (*RuleNoIssueNumber) Suggestion

func (r *RuleNoIssueNumber) Suggestion(rs RuleSuggestion) string

func (*RuleNoIssueNumber) Validate

func (r *RuleNoIssueNumber) Validate(commit *object.Commit) (bool, string)

type RuleNoLeadingWhitespace

type RuleNoLeadingWhitespace struct {
}

func (*RuleNoLeadingWhitespace) BreakWhenInvalid

func (r *RuleNoLeadingWhitespace) BreakWhenInvalid() bool

func (*RuleNoLeadingWhitespace) Validate

func (r *RuleNoLeadingWhitespace) Validate(commit *object.Commit) (bool, string)

type RuleNoMerge

type RuleNoMerge struct {
}

func (*RuleNoMerge) BreakWhenInvalid

func (r *RuleNoMerge) BreakWhenInvalid() bool

func (*RuleNoMerge) Suggestion

func (r *RuleNoMerge) Suggestion(rs RuleSuggestion) string

func (*RuleNoMerge) Validate

func (r *RuleNoMerge) Validate(commit *object.Commit) (bool, string)

type RuleNoSingleWord

type RuleNoSingleWord struct {
}

func (*RuleNoSingleWord) BreakWhenInvalid

func (r *RuleNoSingleWord) BreakWhenInvalid() bool

func (*RuleNoSingleWord) Suggestion

func (r *RuleNoSingleWord) Suggestion(rs RuleSuggestion) string

func (*RuleNoSingleWord) Validate

func (r *RuleNoSingleWord) Validate(commit *object.Commit) (bool, string)

type RuleNoTrailingPunct

type RuleNoTrailingPunct struct {
}

func (*RuleNoTrailingPunct) BreakWhenInvalid

func (r *RuleNoTrailingPunct) BreakWhenInvalid() bool

func (*RuleNoTrailingPunct) Suggestion

func (r *RuleNoTrailingPunct) Suggestion(rs RuleSuggestion) string

func (*RuleNoTrailingPunct) Validate

func (r *RuleNoTrailingPunct) Validate(commit *object.Commit) (bool, string)

type RuleSuggestion

type RuleSuggestion struct {
	Highlight  string
	Title      string
	Verb       string
	Suggestion string
	Branch     string
	Error      string
}

type RuleTitleLength

type RuleTitleLength struct {
	MaxLength int
}

func (*RuleTitleLength) BreakWhenInvalid

func (r *RuleTitleLength) BreakWhenInvalid() bool

func (*RuleTitleLength) Suggestion

func (r *RuleTitleLength) Suggestion(rt lengthRule) string

func (*RuleTitleLength) Validate

func (r *RuleTitleLength) Validate(commit *object.Commit) (bool, string)

Jump to

Keyboard shortcuts

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