Skip to content

Commit

Permalink
feat: add info log message about dev deps suppression (#6211)
Browse files Browse the repository at this point in the history
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
  • Loading branch information
DmitriyLewen and knqyf263 committed Mar 4, 2024
1 parent c1d26ec commit 7cb6c02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/scanner/local/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"sort"
"strings"
"sync"

"github.com/google/wire"
"github.com/samber/lo"
Expand Down Expand Up @@ -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
})
}
Expand Down

0 comments on commit 7cb6c02

Please sign in to comment.