Skip to content

Bug: multi-line pubspec.yaml dependencies create bogus packages named version, url, path or ref #583

Closed

Description

@vibgrate-team

Context

parsePubspecYaml in src/core-open/scanners/dart-scanner.ts only reads one-line entries (name: constraint). For the map form it skips the package line (nothing after the colon) and then matches the nested keys as if they were packages:

dependencies:
  http:
    version: ^1.2.0
  shared:
    path: ../shared
  analyzer_plugin:
    git:
      url: https://github.com/example/plugin.git
      ref: main

This yields rows named version, path, url and ref, and the real http, shared and analyzer_plugin dependencies are missing from vg scan and vg sbom export.

What to do

  • Track indentation: a two-space key with no value opens a dependency entry, and deeper keys belong to it.
  • Use a nested version: as the constraint; record path: and git: dependencies with their source rather than a version (or skip them deliberately, but never emit the nested key as a package).
  • Keep the existing sdk: flutter skip, and add unit tests.

Acceptance

  • The example above yields http (^1.2.0), and no packages named version, path, url, ref or git.
  • path: / git: dependencies are handled deliberately and documented in a test.
  • One-line entries behave exactly as today.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. vibgrate-team commented on Nov 4, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed: parsePubspecYaml in src/core-open/scanners/dart-scanner.ts only understands name: constraint lines, so the nested version:, path:, url: and ref: keys of the map form are picked up as package names.

    The fix is mostly about indentation: record the indent of the line that opens a dependency (a key with no value at the section's child level), treat deeper lines as belonging to it, and only read version: from them. path: and git: dependencies have no registry version, so emitting them with their source (or deliberately skipping them) is fine as long as a test documents which.

  3. added a commit that references this issue on Nov 5, 2026
    0624f83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions