MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / compilePatterns

Function compilePatterns

lint/linter.go:105–115  ·  view source on GitHub ↗
(patterns []string)

Source from the content-addressed store, hash-verified

103}
104
105func compilePatterns(patterns []string) ([]*regexp.Regexp, error) {
106 compiled := make([]*regexp.Regexp, 0, len(patterns))
107 for _, p := range patterns {
108 re, err := regexp.Compile(p)
109 if err != nil {
110 return nil, fmt.Errorf("invalid ignore pattern %q: %w", p, err)
111 }
112 compiled = append(compiled, re)
113 }
114 return compiled, nil
115}
116
117// Lint checks the given Commit against rules
118func (l *Linter) Lint(msg Commit) (*Result, error) {

Callers 1

newLinterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected