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

Function newDefaultLinter

test/helpers_test.go:43–55  ·  view source on GitHub ↗

newDefaultLinter creates a linter with default config for testing

(t *testing.T)

Source from the content-addressed store, hash-verified

41
42// newDefaultLinter creates a linter with default config for testing
43func newDefaultLinter(t *testing.T) *lint.Linter {
44 t.Helper()
45 conf := config.NewDefault()
46 rules, err := config.GetEnabledRules(conf)
47 if err != nil {
48 t.Fatalf("failed to get enabled rules: %v", err)
49 }
50 linter, err := lint.New(conf, rules)
51 if err != nil {
52 t.Fatalf("failed to create linter: %v", err)
53 }
54 return linter
55}

Calls 3

NewDefaultFunction · 0.92
GetEnabledRulesFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected