Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGetMessage = errors.New("get commit message") ErrGetChangedFiles = errors.New("get changed files") ErrShaLength = errors.New("sha length must be greater than 0") )
View Source
var ErrConfigRead = errors.New("error reading config")
View Source
var ErrInvalidGlobPattern = errors.New("invalid glob pattern")
View Source
var ErrRegexDecode = errors.New("expected string for regexp decode")
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.5.0
type Config struct {
ScopeRegex *regexp.Regexp `mapstructure:"scopeRegex"`
Patterns map[string][]string `mapstructure:"patterns"`
}
func LoadConfig ¶ added in v0.5.0
type DefaultGit ¶ added in v0.4.0
type DefaultGit struct {
// contains filtered or unexported fields
}
func NewDefaultGit ¶ added in v0.4.0
func NewDefaultGit(baseDir string) *DefaultGit
func (*DefaultGit) FilesChanged ¶ added in v0.4.0
type DefaultOutsiderFinder ¶ added in v0.5.0
type DefaultOutsiderFinder struct {
// contains filtered or unexported fields
}
DefaultOutsiderFinder checks whether files match predefined glob patterns for a given scope.
func NewDefaultOutsiderFinder ¶ added in v0.5.0
func NewDefaultOutsiderFinder(scopesToPatterns map[string][]string) (*DefaultOutsiderFinder, error)
NewDefaultOutsiderFinder creates a new DefaultOutsiderFinder. scopesToPatterns is a map from scope name to a list of glob pattern strings.
type DefaultScopeParser ¶ added in v0.5.0
type DefaultScopeParser struct {
// contains filtered or unexported fields
}
func NewDefaultScopeParser ¶ added in v0.5.0
func NewDefaultScopeParser(scopeRegex *regexp.Regexp) *DefaultScopeParser
func (*DefaultScopeParser) Parse ¶ added in v0.5.0
func (p *DefaultScopeParser) Parse(message string) string
type Options ¶ added in v0.4.0
type Options struct {
Logger *slog.Logger
SHALength int
Git Git
OutsiderFinder OutsiderFinder
ScopeParser ScopeParser
}
type Outsider ¶ added in v0.5.0
type Outsider struct {
File string `json:"file,omitempty"`
UnmatchedPatterns []string `json:"unmatchedPatterns,omitempty"`
}
Outsider holds a file that failed the scope check and the patterns that were tested.
type OutsiderFinder ¶
type ScopeParser ¶
Click to show internal directories.
Click to hide internal directories.