From 7cb6c02a4e2ad1c632a70804111a5048d1c0d1f6 Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:30:30 +0600 Subject: [PATCH] feat: add info log message about dev deps suppression (#6211) Co-authored-by: Teppei Fukuda --- pkg/scanner/local/scan.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/scanner/local/scan.go b/pkg/scanner/local/scan.go index e4025f17945c..98fc3d4d7571 100644 --- a/pkg/scanner/local/scan.go +++ b/pkg/scanner/local/scan.go @@ -6,6 +6,7 @@ import ( "fmt" "sort" "strings" + "sync" "github.com/google/wire" "github.com/samber/lo" @@ -424,8 +425,15 @@ func excludeDevDeps(apps []ftypes.Application, include bool) { if include { return } + + onceInfo := sync.OnceFunc(func() { + log.Logger.Info("Suppressing dependencies for development and testing. To display them, try the '--include-dev-deps' flag.") + }) for i := range apps { apps[i].Libraries = lo.Filter(apps[i].Libraries, func(lib ftypes.Package, index int) bool { + if lib.Dev { + onceInfo() + } return !lib.Dev }) }