Skip to content

feat(scanner) add dev flag in library#2405

Merged
MaineK00n merged 9 commits intomasterfrom
add_dev_flag_in_library
Feb 5, 2026
Merged

feat(scanner) add dev flag in library#2405
MaineK00n merged 9 commits intomasterfrom
add_dev_flag_in_library

Conversation

@sadayuki-matsuno
Copy link
Copy Markdown
Collaborator

@sadayuki-matsuno sadayuki-matsuno commented Feb 4, 2026

Summary

Move dev dependency detection control from AnalyzeLibrary (scanner) to DetectLibsCves (detector).

Changes

  • Add DetectDevLockfilePaths field to TrivyOpts
  • Scanner now always includes dev dependencies (preserves Dev flag)
  • DetectLibsCves skips vulnerability detection for dev dependencies unless the lockfile path is specified in DetectDevLockfilePaths
  • Remove includeDevDependencies parameter from AnalyzeLibrary

Usage

  [trivyOpts]
  detectDevLockfilePaths = [
    "path/to/package-lock.json",
    "path/to/yarn.lock"
  ]

Only the specified lockfiles will detect vulnerabilities in dev dependencies. If not specified, dev dependencies are skipped (default behavior).

Comment thread contrib/trivy/pkg/converter.go Outdated
Comment thread detector/library.go Outdated
Comment thread detector/library.go Outdated
Copy link
Copy Markdown
Collaborator

@MaineK00n MaineK00n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📖

@MaineK00n MaineK00n merged commit a0bc223 into master Feb 5, 2026
7 checks passed
@MaineK00n MaineK00n deleted the add_dev_flag_in_library branch February 5, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants