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

Function newDefaultLinter

test/helpers_test.go:94–106  ·  view source on GitHub ↗

newDefaultLinter creates a linter with default config for testing

(t *testing.T)

Source from the content-addressed store, hash-verified

92
93// newDefaultLinter creates a linter with default config for testing
94func newDefaultLinter(t *testing.T) *lint.Linter {
95 t.Helper()
96 conf := config.NewDefault()
97 rules, err := config.GetEnabledRules(conf)
98 if err != nil {
99 t.Fatalf("failed to get enabled rules: %v", err)
100 }
101 linter, err := lint.New(conf, rules)
102 if err != nil {
103 t.Fatalf("failed to create linter: %v", err)
104 }
105 return linter
106}

Calls 3

NewDefaultFunction · 0.92
GetEnabledRulesFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected