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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/validator/license.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_generated/lib/src/validator/license.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/license.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/license.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8d19d541e83ad8c5b7f946d6b5fccc93e5f6233e
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/license.dart
@@ -0,0 +1,23 @@
+library pub.validator.license;
+import 'dart:async';
+import 'package:path/path.dart' as path;
+import '../entrypoint.dart';
+import '../io.dart';
+import '../utils.dart';
+import '../validator.dart';
+class LicenseValidator extends Validator {
+ LicenseValidator(Entrypoint entrypoint) : super(entrypoint);
+ Future validate() {
+ return syncFuture(() {
+ var licenseLike =
+ new RegExp(r"^([a-zA-Z0-9]+[-_])?(LICENSE|COPYING)(\..*)?$");
+ if (listDir(
+ entrypoint.root.dir).map(path.basename).any(licenseLike.hasMatch)) {
+ return;
+ }
+ errors.add(
+ "You must have a COPYING or LICENSE file in the root directory.\n"
+ "An open-source license helps ensure people can legally use your " "code.");
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698