isIgnored checks if the first line of the commit message matches any of the configured ignore patterns
(commitMsg string)
| 89 | // isIgnored checks if the first line of the commit message |
| 90 | // matches any of the configured ignore patterns |
| 91 | func (l *Linter) isIgnored(commitMsg string) bool { |
| 92 | if len(l.ignorePatterns) == 0 { |
| 93 | return false |
| 94 | } |
| 95 | |
| 96 | firstLine := commit.FirstLine(commitMsg) |
| 97 | for _, re := range l.ignorePatterns { |
| 98 | if re.MatchString(firstLine) { |
| 99 | return true |
| 100 | } |
| 101 | } |
| 102 | return false |
| 103 | } |
| 104 | |
| 105 | func compilePatterns(patterns []string) ([]*regexp.Regexp, error) { |
| 106 | compiled := make([]*regexp.Regexp, 0, len(patterns)) |
no test coverage detected