Skip to content

dart pub publish --dry-run analyzes all Dart files with regard to toplevel pubspec.yaml #3982

Open
@dcharkes

Description

@dcharkes

Problem

We're analyzing all Dart files w.r.t. the toplevel pubspec.yaml, not w.r.t. the first pubspec.yaml found when walking folders up.

Actual behavior

The toplevel pubspec.yaml is used.

Package validation found the following potential issues:
* line 7, column 1 of test/data/native_add_add_source/build.dart: This package does not have native_toolchain_c in the `dependencies` or `dev_dependencies` section of `pubspec.yaml`.
    ╷
  7 │ import 'package:native_toolchain_c/native_toolchain_c.dart';
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

This behavior is inconsistent with dart analyze.

Expected behavior

No errors, there is a pubspec.yaml inside test/data/native_add_add_source/ that contains a dependency on native_toolchain_c.

I expect the behavior to be similar to dart analyze respecting other pubspec.yamls.

Related issues

This issue seems to be related to:

Both of these issues have to do with assuming that there is only a single pubspec.yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions