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

Method isIgnored

lint/linter.go:91–103  ·  view source on GitHub ↗

isIgnored checks if the first line of the commit message matches any of the configured ignore patterns

(commitMsg string)

Source from the content-addressed store, hash-verified

89// isIgnored checks if the first line of the commit message
90// matches any of the configured ignore patterns
91func (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
105func compilePatterns(patterns []string) ([]*regexp.Regexp, error) {
106 compiled := make([]*regexp.Regexp, 0, len(patterns))

Callers 1

ParseAndLintMethod · 0.95

Calls 1

FirstLineFunction · 0.92

Tested by

no test coverage detected