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

Unified Diff: sdk/lib/_internal/pub/lib/src/validator/directory.dart

Issue 1165473002: Start pulling pub from its own repo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 7 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
Index: sdk/lib/_internal/pub/lib/src/validator/directory.dart
diff --git a/sdk/lib/_internal/pub/lib/src/validator/directory.dart b/sdk/lib/_internal/pub/lib/src/validator/directory.dart
deleted file mode 100644
index 6039fc5c3b02f9be04a4568fe87e1bfab218d64c..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/validator/directory.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub.validator.directory;
-
-import 'dart:async';
-
-import 'package:path/path.dart' as path;
-
-import '../entrypoint.dart';
-import '../io.dart';
-import '../validator.dart';
-
-/// A validator that validates a package's top-level directories.
-class DirectoryValidator extends Validator {
- DirectoryValidator(Entrypoint entrypoint)
- : super(entrypoint);
-
- static final _PLURAL_NAMES = [
- "benchmarks", "docs", "examples", "tests", "tools"
- ];
-
- Future validate() {
- return new Future.sync(() {
- for (var dir in listDir(entrypoint.root.dir)) {
- if (!dirExists(dir)) continue;
-
- dir = path.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');
- }
- }
- });
- }
-}

Powered by Google App Engine
This is Rietveld 408576698