Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve invalid package name errors #92

Merged
merged 2 commits into from
Sep 22, 2014
Merged

Improve invalid package name errors #92

merged 2 commits into from
Sep 22, 2014

Conversation

patrickkettner
Copy link
Member

Notcied a number of issues cropping up that boiled down to how bad the error message is, this attempts to fix that.

};
}

return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh rad. One suggestion - could return multiple errors if the package name fails on multiple rules?

@patrickkettner
Copy link
Member Author

yes. yes i could.

@patrickkettner
Copy link
Member Author

these are all of the possible generated values - any copy suggestions?

Package names must be between 1 and 50 characters.                               
Package names must only contain lower case a through z, 0 through 9, dots, dashes, and underscores.
Package names must not have consecutive dashes, dots, or underscores.            
Package names must not start or end with dashes, dots, or underscores.           
Package names must be between 1 and 50 characters, and must only contain lower case a through z, 0 through 9, dots, dashes, and underscores.
Package names must be between 1 and 50 characters, and must not have consecutive dashes, dots, or underscores.
Package names must be between 1 and 50 characters, and must not start or end with dashes, dots, or underscores.
Package names must only contain lower case a through z, 0 through 9, dots, dashes, and underscores, and must not have consecutive dashes, dots, or underscores.
Package names must only contain lower case a through z, 0 through 9, dots, dashes, and underscores, and must not start or end with dashes, dots, or underscores.
Package names must not have consecutive dashes, dots, or underscores, and must not start or end with dashes, dots, or underscores.
Package names must be between 1 and 50 characters, only contain lower case a through z, 0 through 9, dots, dashes, and underscores, and must not have consecutive dashes, dots, or underscores.
Package names must be between 1 and 50 characters, not have consecutive dashes, dots, or underscores, and must not start or end with dashes, dots, or underscores.
Package names must be between 1 and 50 characters, only contain lower case a through z, 0 through 9, dots, dashes, and underscores, and must not start or end with dashes, dots, or underscores.
Package names must only contain lower case a through z, 0 through 9, dots, dashes, and underscores, not have consecutive dashes, dots, or underscores, and must not start or end with dashes, dots, or underscores.
Package names must be between 1 and 50 characters, only contain lower case a through z, 0 through 9, dots, dashes, and underscores, not have consecutive dashes, dots, or underscores, and must not start or end with dashes, dots, or underscores.

if (length) {

if (length > 1) {
errors[length - 1] = 'and must ' + errors[length - 1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we loop through errors? If there are 3 errors, this only modifies the 2nd one but not the 3rd one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind i just reviewed the copy, it makes sense

@rayshan
Copy link
Member

rayshan commented Sep 19, 2014

Thanks! copy looks good. overall lgtm.

@rayshan rayshan mentioned this pull request Sep 19, 2014
3 tasks
@patrickkettner
Copy link
Member Author

@desandro - you good?

@desandro
Copy link
Member

thumbs up

rayshan added a commit that referenced this pull request Sep 22, 2014
Improve invalid package name errors
@rayshan rayshan merged commit 4733305 into master Sep 22, 2014
@rayshan rayshan deleted the improved-name-err branch September 22, 2014 05:48
@rayshan
Copy link
Member

rayshan commented Sep 22, 2014

deployed, thanks @patrickkettner @desandro

@paulirish
Copy link
Member

Yay for communicative error messages! nice one @patrickkettner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants