issues

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package issues provides filters for problems found in commit messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter func(*commits.Commit) Issue

Filter identifies an issue with a commit. A filter returning a zero-valued Issue signals that it found no issue with the commit.

func OfBlankLine

func OfBlankLine() Filter

OfBlankLine tests if commit message have a blank line between subject and body.

func OfBodyMaxLength

func OfBodyMaxLength(max int) Filter

OfBodyMaxLength checks that a commit's body's length doesn't exceed this max number of characters.

func OfBodyRegex

func OfBodyRegex(regex string) Filter

OfBodyRegex tests a commit's body with the regex.

func OfSubjectMaxLength

func OfSubjectMaxLength(length int) Filter

OfSubjectMaxLength checks that a commit's subject does not exceed this length.

func OfSubjectMinLength

func OfSubjectMinLength(min int) Filter

OfSubjectMinLength checks that a commit's subject's length is at least of length min.

func OfSubjectRegex

func OfSubjectRegex(regex string) Filter

OfSubjectRegex tests a commit's subject with the regex.

type Issue

type Issue struct {
	Desc   string
	Commit commits.Commit
}

Issue is a problem found with a commit.

type Issues

type Issues func() []Issue

Issues is a collection of Issues.

func Collected

func Collected(filters []Filter, cmts commits.Commits) Issues

Collected returns a collection of issues identified.

func Printed

func Printed(w io.Writer, sep string, issues Issues) Issues

Printed prints the issues to the writer.

Jump to

Keyboard shortcuts

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