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

Method ParseAndLint

lint/linter.go:36–47  ·  view source on GitHub ↗

ParseAndLint checks the given commitMsg string against rules

(commitMsg string)

Source from the content-addressed store, hash-verified

34
35// ParseAndLint checks the given commitMsg string against rules
36func (l *Linter) ParseAndLint(commitMsg string) (*Result, error) {
37 if l.isIgnored(commitMsg) {
38 return newResult(commitMsg), nil
39 }
40
41 msg, err := l.parser.Parse(commitMsg)
42 if err != nil {
43 issues := l.parserErrorRule(commitMsg, err)
44 return newResult(commitMsg, issues...), nil
45 }
46 return l.Lint(msg)
47}
48
49// isIgnored checks if the first line of the commit message
50// matches any of the configured ignore patterns

Calls 5

isIgnoredMethod · 0.95
parserErrorRuleMethod · 0.95
LintMethod · 0.95
newResultFunction · 0.85
ParseMethod · 0.65