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

Function TestIgnore_EmptyPatterns_NoSkip

test/ignore_test.go:167–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestIgnore_EmptyPatterns_NoSkip(t *testing.T) {
168 conf := config.NewDefault()
169 conf.DisableDefaultIgnores = true
170 conf.IgnorePatterns = []string{}
171
172 rules, err := config.GetEnabledRules(conf)
173 if err != nil {
174 t.Fatalf("unexpected error: %v", err)
175 }
176 linter, err := lint.New(conf, rules)
177 if err != nil {
178 t.Fatalf("unexpected error: %v", err)
179 }
180
181 result, err := linter.ParseAndLint("Merge pull request #123 from owner/branch")
182 if err != nil {
183 t.Fatalf("unexpected error: %v", err)
184 }
185 if len(result.Issues()) == 0 {
186 t.Error("expected merge to fail when all ignore patterns disabled")
187 }
188}
189
190func TestIgnore_CustomPatternsAdditive(t *testing.T) {
191 conf := config.NewDefault()

Callers

nothing calls this directly

Calls 6

NewDefaultFunction · 0.92
GetEnabledRulesFunction · 0.92
NewFunction · 0.92
ParseAndLintMethod · 0.80
IssuesMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected