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

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

Issue 12079112: Make a bunch of stuff in pub synchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix after merge. Created 7 years, 11 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 | « utils/pub/validator/compiled_dartdoc.dart ('k') | utils/pub/validator/directory.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 18cff6624b013321e2dc78b7713349f05f89e5f1..a848c545574db233111e1e1e698822e96915c8c1 100644
--- a/utils/pub/validator/dependency.dart
+++ b/utils/pub/validator/dependency.dart
@@ -38,7 +38,7 @@ class DependencyValidator extends Validator {
// should warn about unittest. Until then, it's reasonable not to put
// a constraint on it.
dependency.name != 'unittest') {
- return _warnAboutConstraint(dependency);
+ _warnAboutConstraint(dependency);
}
return new Future.immediate(null);
@@ -74,21 +74,20 @@ class DependencyValidator extends Validator {
}
/// Warn that dependencies should have version constraints.
- Future _warnAboutConstraint(PackageRef ref) {
- return entrypoint.loadLockFile().then((lockFile) {
- var message = 'Your dependency on "${ref.name}" should have a version '
- 'constraint.';
- var locked = lockFile.packages[ref.name];
- if (locked != null) {
- message = '$message For example:\n'
- '\n'
- 'dependencies:\n'
- ' ${ref.name}: ${_constraintForVersion(locked.version)}\n';
- }
- warnings.add("$message\n"
- "Without a constraint, you're promising to support all future "
- "versions of ${ref.name}.");
- });
+ void _warnAboutConstraint(PackageRef ref) {
+ var lockFile = entrypoint.loadLockFile();
+ var message = 'Your dependency on "${ref.name}" should have a version '
+ 'constraint.';
+ var locked = lockFile.packages[ref.name];
+ if (locked != null) {
+ message = '$message For example:\n'
+ '\n'
+ 'dependencies:\n'
+ ' ${ref.name}: ${_constraintForVersion(locked.version)}\n';
+ }
+ warnings.add("$message\n"
+ "Without a constraint, you're promising to support all future "
+ "versions of ${ref.name}.");
}
/// Returns the suggested version constraint for a dependency that was tested
« no previous file with comments | « utils/pub/validator/compiled_dartdoc.dart ('k') | utils/pub/validator/directory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698