matchers

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(features Features, matchers Config) *[]Matcher

Create builds matchers from a config

func Filter

func Filter(matchers *[]Matcher, commits *[]object.Commit) *[]map[string]interface{}

Filter filters commits that don't fit any matchers

func GetTypes

func GetTypes() []string

GetTypes returns all defined matchers types

Types

type Config

type Config struct {
	MESSAGE   *regexp.Regexp
	COMMITTER *regexp.Regexp
	AUTHOR    *regexp.Regexp
	TYPE      string
}

Config centralizes config needed for each matcher

type Features

type Features struct {
	ENABLED   bool
	MESSAGE   bool
	COMMITTER bool
	AUTHOR    bool
	TYPE      bool
}

Features gives which matchers are enabled

type Matcher

type Matcher interface {
	Match(*object.Commit) bool
}

Matcher describes a way of applying a matcher against a commit

Jump to

Keyboard shortcuts

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