diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index e55e0d5ba4db..aa2b03ff944e 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -308,9 +308,7 @@ func (e *Engine) setDefaults(ctx context.Context) { e.decoders = decoders.DefaultDecoders() } - if len(e.detectors) == 0 { - e.detectors = DefaultDetectors() - } + e.detectors = append(e.detectors, DefaultDetectors()...) if e.dispatcher == nil { e.dispatcher = NewPrinterDispatcher(new(output.PlainPrinter)) diff --git a/pkg/engine/engine_test.go b/pkg/engine/engine_test.go index 5331553a3f12..b620c5fe5b58 100644 --- a/pkg/engine/engine_test.go +++ b/pkg/engine/engine_test.go @@ -417,12 +417,13 @@ func TestVerificationOverlapChunk(t *testing.T) { sourceManager := sources.NewManager(opts...) c := Config{ - Concurrency: 1, - Decoders: decoders.DefaultDecoders(), - Detectors: conf.Detectors, - Verify: false, - SourceManager: sourceManager, - Dispatcher: NewPrinterDispatcher(new(discardPrinter)), + Concurrency: 1, + Decoders: decoders.DefaultDecoders(), + Detectors: conf.Detectors, + IncludeDetectors: "904", // isolate this test to only the custom detectors provided + Verify: false, + SourceManager: sourceManager, + Dispatcher: NewPrinterDispatcher(new(discardPrinter)), } e, err := NewEngine(ctx, &c)