-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart pub publish --dry-run
analyzes all Dart files with regard to toplevel pubspec.yaml
#3982
Comments
As a workaround:
|
There is no harm to doing |
Option (2) won't really work, this issue is from: https://github.com/dart-lang/pub/blob/master/lib/src/validator/strict_dependencies.dart |
Note that as of #4068 we no longer analyze |
I don't believe this is true.
|
It's a different validator /// Validates that no Dart files in `benchmark/`, `test/` or
/// `tool/` have dependencies that aren't in [deps] or [devDeps].
void _validateBenchmarkTestTool(Set<String> deps, Set<String> devDeps) {
var directories = ['benchmark', 'test', 'tool'];
for (var usage in _usagesBeneath(directories)) {
if (!deps.contains(usage.package) && !devDeps.contains(usage.package)) {
warnings.add(usage.dependenciesMissingMessage());
}
}
} @sigurdm I don't believe it makes sense to check for /// Returns the [files] that are inside [dir] (relative to the package
/// entrypoint).
// TODO(sigurdm): Consider moving this to a more central location.
List<String> filesBeneath(String dir, {required bool recursive}) {
final base = p.canonicalize(p.join(entrypoint.rootDir, dir));
return files
.where(
recursive
? (file) => p.canonicalize(file).startsWith(base)
: (file) => p.canonicalize(p.dirname(file)) == base,
)
.toList();
} Maybe this should stop recursing if it finds a It should also respect Currently the workaround of adding things to |
The validation was made before my time. I think the general idea is that you want the package to be in a good shape before publishing. If you have errors in
The The
That is a possibility. But it is hard to know if the pubspec.yaml is there as testdata or as a genuine project. Maybe the rule should be that we make a convention not to analyze things within |
Problem
We're analyzing all Dart files w.r.t. the toplevel
pubspec.yaml
, not w.r.t. the firstpubspec.yaml
found when walking folders up.Actual behavior
The toplevel
pubspec.yaml
is used.This behavior is inconsistent with
dart analyze
.Expected behavior
No errors, there is a
pubspec.yaml
insidetest/data/native_add_add_source/
that contains a dependency onnative_toolchain_c
.I expect the behavior to be similar to
dart analyze
respecting otherpubspec.yaml
s.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
.The text was updated successfully, but these errors were encountered: