-
Notifications
You must be signed in to change notification settings - Fork 623
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
Add better error message for invalid crate names #7603
Conversation
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔢 Self-check
"detail": "\"🦀\" is an invalid dependency name (dependency names must start with a letter, contain only letters, numbers, hyphens, or underscores and have at most 64 characters)" | ||
"detail": "invalid character `🦀` in crate name: `🦀`, the first character must be an ASCII character" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously the error message was warning about a dependency name, but now it is only saying "crate name". maybe we need another error wrapper to give more context in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice catch. I will update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I submitted ccbcaee
I don't know if this is a good way to do it. Maybe it just introduces more confusion.
Do you have any suggestions to improve it? Or maybe we can keep it as the crate
name. Because it literally is a crate name.
Signed-off-by: hi-rustin <[email protected]>
Split from #7379
The summary:
2. can only start with most letters or
_
3. can only contain numbers,
-
,_
, or most letters.2. can only contain numbers, letters,
-
,_
2. can only contain numbers, letters,
-
,_
(Nothing changes)