MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / compilePatterns

Function compilePatterns

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

Source from the content-addressed store, hash-verified

63}
64
65func compilePatterns(patterns []string) ([]*regexp.Regexp, error) {
66 compiled := make([]*regexp.Regexp, 0, len(patterns))
67 for _, p := range patterns {
68 re, err := regexp.Compile(p)
69 if err != nil {
70 return nil, fmt.Errorf("invalid ignore pattern %q: %w", p, err)
71 }
72 compiled = append(compiled, re)
73 }
74 return compiled, nil
75}
76
77// Lint checks the given Commit against rules
78func (l *Linter) Lint(msg Commit) (*Result, error) {

Callers 1

NewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected