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

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

Issue 11557008: Make pub publish more user friendly: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge in path changes. Created 8 years 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/license.dart ('k') | utils/pub/validator/pubspec_field.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/name.dart
diff --git a/utils/pub/validator/name.dart b/utils/pub/validator/name.dart
index ecc34e4b370ee096df136b650a42909f0e6242f6..687cfc72ca1e8c0fba028a6553d05df22ee80eb1 100644
--- a/utils/pub/validator/name.dart
+++ b/utils/pub/validator/name.dart
@@ -45,14 +45,15 @@ class NameValidator extends Validator {
if (name == "") {
errors.add("$description may not be empty.");
} else if (!new RegExp(r"^[a-zA-Z0-9_]*$").hasMatch(name)) {
- errors.add("$description must be a valid Dart identifier: it may only "
- "contain letters, numbers, and underscores.");
+ errors.add("$description may only contain letters, numbers, and "
+ "underscores.\n"
+ "Using a valid Dart identifier makes the name usable in Dart code.");
} else if (!new RegExp(r"^[a-zA-Z]").hasMatch(name)) {
- errors.add("$description must be a valid Dart identifier: it must begin "
- "with a letter.");
+ errors.add("$description must begin with letter.\n"
+ "Using a valid Dart identifier makes the name usable in Dart code.");
} else if (_RESERVED_WORDS.contains(name.toLowerCase())) {
- errors.add("$description must be a valid Dart identifier: it may not be "
- "a reserved word in Dart.");
+ errors.add("$description may not be a reserved word in Dart.\n"
+ "Using a valid Dart identifier makes the name usable in Dart code.");
} else if (new RegExp(r"[A-Z]").hasMatch(name)) {
warnings.add('$description should be lower-case. Maybe use '
'"${_unCamelCase(name)}"?');
« no previous file with comments | « utils/pub/validator/license.dart ('k') | utils/pub/validator/pubspec_field.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698