| 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');
|
| + }
|
| + }
|
| });
|
| }
|
| }
|
|
|