(t *testing.T)
| 307 | } |
| 308 | |
| 309 | func TestIgnore_EffectiveIgnorePatterns(t *testing.T) { |
| 310 | conf := config.NewDefault() |
| 311 | |
| 312 | // Default: no user patterns, defaults enabled |
| 313 | effective := conf.EffectiveIgnorePatterns() |
| 314 | if len(effective) != len(conf.DefaultIgnorePatterns) { |
| 315 | t.Errorf("expected %d effective patterns, got %d", len(conf.DefaultIgnorePatterns), len(effective)) |
| 316 | } |
| 317 | |
| 318 | // Add user patterns: effective = defaults + user |
| 319 | conf.IgnorePatterns = []string{`^WIP `} |
| 320 | effective = conf.EffectiveIgnorePatterns() |
| 321 | expected := len(conf.DefaultIgnorePatterns) + 1 |
| 322 | if len(effective) != expected { |
| 323 | t.Errorf("expected %d effective patterns, got %d", expected, len(effective)) |
| 324 | } |
| 325 | |
| 326 | // Disable defaults: effective = user only |
| 327 | conf.DisableDefaultIgnores = true |
| 328 | effective = conf.EffectiveIgnorePatterns() |
| 329 | if len(effective) != 1 { |
| 330 | t.Errorf("expected 1 effective pattern (defaults disabled), got %d", len(effective)) |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | func TestIgnore_IgnoredResultHasNoIssues(t *testing.T) { |
| 335 | linter := newDefaultLinter(t) |
nothing calls this directly
no test coverage detected