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

Function New

lint/linter.go:20–33  ·  view source on GitHub ↗

New returns a new Linter instance with given config and rules

(conf *Config, rules []Rule)

Source from the content-addressed store, hash-verified

18
19// New returns a new Linter instance with given config and rules
20func New(conf *Config, rules []Rule) (*Linter, error) {
21 compiled, err := compilePatterns(conf.EffectiveIgnorePatterns())
22 if err != nil {
23 return nil, err
24 }
25
26 l := &Linter{
27 conf: conf,
28 rules: rules,
29 parser: newParser(),
30 ignorePatterns: compiled,
31 }
32 return l, nil
33}
34
35// ParseAndLint checks the given commitMsg string against rules
36func (l *Linter) ParseAndLint(commitMsg string) (*Result, error) {

Calls 3

compilePatternsFunction · 0.85
newParserFunction · 0.85