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

Unified Diff: utils/pub/validator/directory.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/dependency.dart ('k') | utils/pub/validator/lib.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/directory.dart
diff --git a/utils/pub/validator/directory.dart b/utils/pub/validator/directory.dart
index 09a6c7e952b713e94a8f5e103bdf59530693437c..6ab932ca64224ac591826a9de4c575231545093c 100644
--- a/utils/pub/validator/directory.dart
+++ b/utils/pub/validator/directory.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import '../entrypoint.dart';
import '../io.dart';
+import '../utils.dart';
import '../validator.dart';
/// A validator that validates a package's top-level directories.
@@ -19,29 +20,27 @@ class DirectoryValidator extends Validator {
Future validate() {
return listDir(entrypoint.root.dir).then((dirs) {
- return Future.wait(dirs.map((dir) {
- return dirExists(dir).then((exists) {
- if (!exists) return;
-
- dir = basename(dir);
- if (_PLURAL_NAMES.contains(dir)) {
- // Cut off the "s"
- var singularName = dir.substring(0, dir.length - 1);
- warnings.add('Rename the top-level "$dir" directory to '
- '"$singularName".\n'
- 'The Pub layout convention is to use singular directory '
- 'names.\n'
- 'Plural names won\'t be correctly identified by Pub and other '
- 'tools.');
- }
-
- if (dir.contains(new RegExp(r"^samples?$"))) {
- warnings.add('Rename the top-level "$dir" directory to "example".\n'
- 'This allows Pub to find your examples and create "packages" '
- 'directories for them.\n');
- }
- });
- }));
+ for (var dir in dirs) {
+ if (!dirExists(dir)) continue;
+
+ dir = basename(dir);
+ if (_PLURAL_NAMES.contains(dir)) {
+ // Cut off the "s"
+ var singularName = dir.substring(0, dir.length - 1);
+ warnings.add('Rename the top-level "$dir" directory to '
+ '"$singularName".\n'
+ 'The Pub layout convention is to use singular directory '
+ 'names.\n'
+ 'Plural names won\'t be correctly identified by Pub and other '
+ 'tools.');
+ }
+
+ if (dir.contains(new RegExp(r"^samples?$"))) {
+ warnings.add('Rename the top-level "$dir" directory to "example".\n'
+ 'This allows Pub to find your examples and create "packages" '
+ 'directories for them.\n');
+ }
+ }
});
}
}
« no previous file with comments | « utils/pub/validator/dependency.dart ('k') | utils/pub/validator/lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698