Skip to content

Conversation

goldnode
Copy link
Contributor

@goldnode goldnode commented Oct 1, 2025

"Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden"

did not make sense.

This change will display a clear and correct message for the REGEX check being made. '--' / '..' is a later check.

"Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden"

did not make sense.

This change will display a clear and correct message for the REGEX check being made.
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Much better indeed! What do you think of adding the rule about forbidding .. and -- ?

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@goldnode
Copy link
Contributor Author

goldnode commented Oct 1, 2025

Much better indeed! What do you think of adding the rule about forbidding .. and -- ?

I'm not actually sure why '..' and '--' is forbidden to be honest so I didn't want to change the regex, just make the message relevant to the check. The next lines of code (unchanged) already do the '--' and '..' checks though...

if "--" in repo_id or ".." in repo_id:
    raise HFValidationError(f"Cannot have -- or .. in repo_id: '{repo_id}'.")

@Wauplin
Copy link
Contributor

Wauplin commented Oct 2, 2025

The next lines of code (unchanged) already do the '--' and '..' checks though...

Correct! Then let's keep it as it is now :)

I'm not actually sure why '..' and '--' is forbidden to be honest

Purely technical. Since we use -- as delimiter when creating folder in cache, having a -- in the repo name could be misleading. About the .. is was due to a server-side issue that happened with such a name. It is simply easier to forbid these patterns rather than having to think about them in the logic.

@Wauplin Wauplin merged commit ff79763 into huggingface:main Oct 2, 2025
22 checks passed
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