linter

package
v0.0.0-...-5029a70 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSubject   = errors.New("invalid subject in commit message")
	ErrInvalidCharacter = errors.New("invalid character in commit message")
)

Functions

func FilterInitialCommit

func FilterInitialCommit(_ commitparser.CommitMessage, commit *object.Commit, err error) error

func RuleConventionalCommit

func RuleConventionalCommit(msg commitparser.CommitMessage, commit *object.Commit) error

func RuleConventionalSubject

func RuleConventionalSubject(msg commitparser.CommitMessage, _ *object.Commit) error

RuleConventionalSubject verifies that the commit message's subject is not empty and does not start with upper case.

Types

type FilterFunc

type FilterFunc func(message commitparser.CommitMessage, commit *object.Commit, err error) error

type Filters

type Filters []FilterFunc

func (Filters) Filter

func (filters Filters) Filter(msg commitparser.CommitMessage, commit *object.Commit, err error) error

type Linter

type Linter struct {
	Filters Filters
	Rules   Rules
}

func (Linter) Lint

func (l Linter) Lint(commit *object.Commit) error

Lint commit to ensures that it adheres to Conventional Commits 1.0.0.

type RuleFunc

type RuleFunc func(message commitparser.CommitMessage, commit *object.Commit) error

type Rules

type Rules []RuleFunc

func (Rules) Validate

func (rules Rules) Validate(message commitparser.CommitMessage, commit *object.Commit) error

Jump to

Keyboard shortcuts

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