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

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: Code review changes 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') | no next file with comments »
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..46cde9acc690c2094cd8286bf2dd5fc8833a8a33 100644
--- a/utils/pub/validator/dependency.dart
+++ b/utils/pub/validator/dependency.dart
@@ -23,6 +23,14 @@ class DependencyValidator extends Validator {
return _warnAboutSource(dependency);
}
+ if (dependency.name == entrypoint.root.name) {
+ warnings.add('You don\'t need to explicitly depend on your own '
+ 'package.\n'
+ 'Pub enables "package:${entrypoint.root.name}" imports '
+ 'implicitly.');
+ return new Future.immediate(null);
+ }
+
if (dependency.constraint.isAny &&
// TODO(nweiz): once we have development dependencies (issue 5358), we
// should warn about unittest. Until then, it's reasonable not to put
« no previous file with comments | « no previous file | utils/tests/pub/validator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698