Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: lib/src/validator/dependency_override.dart

Issue 2276143002: Loosen dependency override validation. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/validator/dependency_override_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/validator/dependency_override.dart
diff --git a/lib/src/validator/dependency_override.dart b/lib/src/validator/dependency_override.dart
index ff2fb43498ed677d46cea0b797ac4ce316fa3ca0..36985ba847059323e421285dd4a24fa2efefa886 100644
--- a/lib/src/validator/dependency_override.dart
+++ b/lib/src/validator/dependency_override.dart
@@ -14,9 +14,12 @@ class DependencyOverrideValidator extends Validator {
: super(entrypoint);
Future validate() {
- if (entrypoint.root.dependencyOverrides.isNotEmpty) {
+ var overridden =
+ entrypoint.root.dependencyOverrides.map((dep) => dep.name).toSet();
+ var dev = entrypoint.root.devDependencies.map((dep) => dep.name).toSet();
+ if (overridden.difference(dev).isNotEmpty) {
errors.add(
- 'Your pubspec.yaml must not have a "dependency_overrides" field.\n'
+ 'Your pubspec.yaml must not override non-dev dependencies.\n'
'This ensures you test your package against the same versions of '
'its dependencies\n'
'that users will have when they use it.');
« no previous file with comments | « no previous file | test/validator/dependency_override_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698