(patterns []string)
| 103 | } |
| 104 | |
| 105 | func 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 |
| 118 | func (l *Linter) Lint(msg Commit) (*Result, error) { |