Skip to content

Conversation

@mitchellwrosen
Copy link
Member

Overview

New project name rules: 1+ characters in the set {ascii letter, digit, -, _}. Can't be p or code.

( "Please"
<> IP.makeExample IP.projectRenameInputPattern []
<> "them using only ASCII letters, numbers, and hyphens, of length 2-40 characters."
<> "them using only ASCII letters, numbers, hyphens, and underscores. (You also can't use the name 'code' or 'p')."
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update this to only add "(You also can't use the names 'code' or p.)" if they do have projects with one of those names. Note "name" -> "names" and ")." -> ".)"

chunkLength :: (Maybe Char, Text) -> Int
chunkLength (maybeHyphen, chunk) =
(if isJust maybeHyphen then 1 else 0) + Text.length chunk
name <- Megaparsec.takeWhile1P Nothing \c -> Char.isAscii c || Char.isDigit c || c == '-' || c == '_'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Char.isAscii will accept "@#$%^" etc. and probably should be Char.isAsciiUpper c || Char.isAsciiLower c?

If so, it's begging for some unit tests!

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, good catch! Nonetheless I don't think this needs unit tests, but it does need to be right 😛

Copy link
Contributor

@aryairani aryairani left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix

@aryairani aryairani merged commit 27c18a4 into trunk Sep 30, 2025
31 checks passed
@aryairani aryairani deleted the project-name branch September 30, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants