linter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LintError

type LintError struct {
	CommitHash string
	Message    string
	FixSteps   string
}

type Linter

type Linter struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) *Linter

func (*Linter) LintCommitMessage

func (l *Linter) LintCommitMessage(message string) error

LintCommitMessage lints a single commit message from a string

func (*Linter) LintCommitMessageFile

func (l *Linter) LintCommitMessageFile(filepath string) error

LintCommitMessageFile lints a commit message from a file path

func (*Linter) LintCommits

func (l *Linter) LintCommits(commitRange string) error

LintCommits lints the commit messages in the given range and returns an error if any commit fails the linting rules. to use in cli, run `git-commit-linter --config=config.yaml --check="HEAD~5..HEAD"` (checks last 5 commits)

Jump to

Keyboard shortcuts

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