(patterns []string)
| 63 | } |
| 64 | |
| 65 | func 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 |
| 78 | func (l *Linter) Lint(msg Commit) (*Result, error) { |