Versions in this module Expand all Collapse all v2 v2.3.0 May 29, 2026 v2.2.0 May 29, 2026 v2.1.0 May 29, 2026 v2.0.1 May 29, 2026 Changes in this version + const ConfigName + var ErrConfigRead = errors.New("error reading config") + var ErrGetChangedFiles = errors.New("get changed files") + var ErrGetMessage = errors.New("get commit message") + var ErrInvalidGlobPattern = errors.New("invalid glob pattern") + var ErrRegexDecode = errors.New("expected string for regexp decode") + var ErrShaLength = errors.New("sha length must be greater than 0") + type Config struct + Patterns map[string][]string + ScopeRegex *regexp.Regexp + func LoadConfig() (Config, error) + type DefaultGit struct + func NewDefaultGit(baseDir string) *DefaultGit + func (d *DefaultGit) FilesChanged(ctx context.Context, sha string) ([]string, error) + func (d *DefaultGit) Message(ctx context.Context, sha string) (string, error) + func (d *DefaultGit) SHA(ctx context.Context, from, to string) ([]string, error) + type DefaultOutsiderFinder struct + func NewDefaultOutsiderFinder(scopesToPatterns map[string][]string) (*DefaultOutsiderFinder, error) + func (f *DefaultOutsiderFinder) Find(scope string, files []string) []Outsider + type DefaultScopeParser struct + func NewDefaultScopeParser(scopeRegex *regexp.Regexp) *DefaultScopeParser + func (p *DefaultScopeParser) Parse(message string) string + type Git interface + FilesChanged func(ctx context.Context, sha string) ([]string, error) + Message func(ctx context.Context, sha string) (string, error) + SHA func(ctx context.Context, from, to string) ([]string, error) + type Options struct + Git Git + Logger *slog.Logger + OutsiderFinder OutsiderFinder + SHALength int + ScopeParser ScopeParser + type Outsider struct + File string + UnmatchedPatterns []string + type OutsiderFinder interface + Find func(scope string, files []string) []Outsider + type ScopeParser interface + Parse func(message string) string + type Validator struct + func NewValidator(cfg Config, options Options) (*Validator, error) + func (v *Validator) Validate(ctx context.Context, from, to string) ([]Violation, error) + type Violation struct + Header string + Outsiders []Outsider + SHA string Other modules containing this package github.com/thumbrise/commitlint-scope