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

Function TestLint_MultipleIssues

test/lint_test.go:304–319  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Multiple issues in a single commit ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

302// ---------------------------------------------------------------------------
303
304func TestLint_MultipleIssues(t *testing.T) {
305 // "invalid: x" -> type-enum (invalid) + header-min-length (10 chars, "invalid: x" = 10)
306 // Actually "invalid: x" = 10 chars so header-min passes. Use something shorter.
307 // "xx: y" -> type: "xx" not in enum (5 chars header < 10)
308 linter := newDefaultLinter(t)
309 result, err := linter.ParseAndLint("xx: y")
310 if err != nil {
311 t.Fatal(err)
312 }
313 if len(result.Issues()) < 2 {
314 t.Errorf("expected >= 2 issues (type-enum + header-min-length), got %d", len(result.Issues()))
315 for _, iss := range result.Issues() {
316 t.Logf(" %s: %s", iss.RuleName(), iss.Description())
317 }
318 }
319}

Callers

nothing calls this directly

Calls 5

newDefaultLinterFunction · 0.85
ParseAndLintMethod · 0.80
IssuesMethod · 0.80
RuleNameMethod · 0.80
DescriptionMethod · 0.65

Tested by

no test coverage detected