-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor use of common strings to enum #4681
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
I think this is worth trying on one of the proposed enum types first, so we can evaluate tradeoffs in how they're implemented. E.g. |
Proposed change
There are several strings (
user
,group
,server
,service
, etc) that are used throughout the code base as keys, for loop items and the likes. These could be considered constants and be moved to one or more enum.Despite making the code more verbose, it would help avoiding pitfalls usually associated with typos just as wrong keys and would trigger explicit errors.
As an example, the content of the
scopes.py
where there's a lot of checks and data extraction using such strings.Alternative options
Don't change anything
Who would use this feature?
Developers of JupyterHub as well as people reading through code for better understanding.
(Optional): Suggest a solution
user
,group
,server
,service
.The text was updated successfully, but these errors were encountered: