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

Add validation to github organization string #345

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

delucchi-cmu
Copy link
Contributor

Change Description

We added this field mostly to create valid hyperlinks, and if the string is invalid, that's no good for anyone!

Checklist

  • This PR is meant for the lincc-frameworks/python-project-template repo and not a downstream one instead.
  • This change is linked to an open issue
  • This change includes integration testing, or is small enough to be covered by existing tests

Copy link
Contributor

@camposandro camposandro left a comment

Choose a reason for hiding this comment

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

Looks good! Out of curiosity, is there any official GitHub naming convention for the repositories and organizations? I tried to look it up online but didn't find anything relevant.

@delucchi-cmu
Copy link
Contributor Author

Great point - and I should have checked first =]

I also couldn't find any resources, but I tried to create a new repo with some weird characters, and the UI helpfully told me the requirements (for repo names):

The repository name can only contain ASCII letters, digits, and the characters ., -, and _.

I tried bad &&++name with space with a response of Your new repository will be created as bad-name-with-space. So the validation for repo names isn't consistent with the actual naming requirements on github, which seems non-ideal.

@delucchi-cmu
Copy link
Contributor Author

Thought about it again, and though our validation is stricter than the real package naming requirements of github, they're closer to (and laxer than) the PEP423/PEP8 recommendations for module/package names. So I think I'm going to count this as done.

@delucchi-cmu delucchi-cmu merged commit 5767313 into main Dec 22, 2023
16 checks passed
@delucchi-cmu delucchi-cmu deleted the delucchi/validation branch December 22, 2023 16:16
@camposandro
Copy link
Contributor

Interesting! I think alphanumeric strings separated by dashes or underscores accommodates what most people use anyway. I guess it's best to have some validation than to have none and at least we prevent having an empty input.

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.

2 participants