Documentation
¶
Index ¶
Constants ¶
View Source
const ConfigName = ".commitlint-scope"
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 ¶
type Config struct {
ScopeRegex *regexp.Regexp `mapstructure:"scopeRegex"`
Patterns map[string][]string `mapstructure:"patterns"`
}
func LoadConfig ¶
type DefaultGit ¶
type DefaultGit struct {
// contains filtered or unexported fields
}
func NewDefaultGit ¶
func NewDefaultGit(baseDir string) *DefaultGit
func (*DefaultGit) FilesChanged ¶
type DefaultOutsiderFinder ¶
type DefaultOutsiderFinder struct {
// contains filtered or unexported fields
}
DefaultOutsiderFinder checks whether files match predefined glob patterns for a given scope.
func NewDefaultOutsiderFinder ¶
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 ¶
type DefaultScopeParser struct {
// contains filtered or unexported fields
}
func NewDefaultScopeParser ¶
func NewDefaultScopeParser(scopeRegex *regexp.Regexp) *DefaultScopeParser
func (*DefaultScopeParser) Parse ¶
func (p *DefaultScopeParser) Parse(message string) string
type Options ¶
type Options struct {
Logger *slog.Logger
SHALength int
Git Git
OutsiderFinder OutsiderFinder
ScopeParser ScopeParser
}
type Outsider ¶
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.