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

Unified Diff: utils/pub/validator/dependency.dart

Issue 11737013: Validate that a package doesn't depend on itself. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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 | utils/tests/pub/validator_test.dart » ('j') | utils/tests/pub/validator_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/dependency.dart
diff --git a/utils/pub/validator/dependency.dart b/utils/pub/validator/dependency.dart
index 66d2ae22f53cddb804d42096f8d7c2cb46674fc3..50655f30f982060754fb1075e587115342458f9d 100644
--- a/utils/pub/validator/dependency.dart
+++ b/utils/pub/validator/dependency.dart
@@ -31,6 +31,14 @@ class DependencyValidator extends Validator {
return _warnAboutConstraint(dependency);
}
+ if (dependency.name == entrypoint.root.name) {
+ warnings.add('You don\'t need to explicitly depend on your own '
+ 'package.\n'
+ 'Pub will make "package:${entrypoint.root.name}" imports work '
+ 'automatically.');
Bob Nystrom 2013/01/03 20:52:45 I find the future tense here a bit confusing. How
nweiz 2013/01/03 21:08:12 Done.
+ return;
+ }
+
return new Future.immediate(null);
});
}
« no previous file with comments | « no previous file | utils/tests/pub/validator_test.dart » ('j') | utils/tests/pub/validator_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698