-
-
Notifications
You must be signed in to change notification settings - Fork 227
split_words: allow numeric suffix in words #432
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
Comments
I've had a few variations of this discussion now. Unfortunately there's no clear cut "best" way to do snake casing with numbers as sometimes it's appropriate to use a separate "word" and sometimes it's not. There is one open PR which will be landing in the next breaking version (#413) which may make the behavior better for your case? But the goals at this point around casing are more about consistency than style, since style is so subjective. |
Yeah, #413 should keep both "V1" and "v1" as "v1" rather than "v_1". |
Thanks, #413 (not splitting all lowercase strings) looks good enough for me. |
Currently the
split_words
logic does not allow numerical suffixes in wordshttps://github.com/triaxtec/openapi-python-client/blob/v.0.9.1/openapi_python_client/utils.py#L14-L17
Applying
sneak_case
for a tag like "v1" it gets transformed into "v_1" .It may be very subjective but in my opinion is ugly, and I would prefer that resulting output after applying
sneak_case
would be "v1".As changing
split_words
is a breaking change (and may be arguable whether the number is part of the word or not) maybe one solution could be to make the behavior ofsplit_words
configurable via config file.The text was updated successfully, but these errors were encountered: