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

Fix str to snake to capture uppercase words followed by an underscore #279

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

spicyPug02
Copy link
Contributor

In ariadne_codegen/utils.py, str_to_snake_case was not capturing uppercase words followed by an underscore. \W in the regex would capture all non word characters, but not an underscore. So, things like 'Router_Get' and 'RouterBGP_Get' would both be converted to 'router_get' instead of 'router_bgp_get' in the second case. This caused issues in module naming in the generated clients. This commit fixes the issue by explicitly adding an underscore to the regex.

Copy link
Contributor

@rafalp rafalp left a comment

Choose a reason for hiding this comment

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

Please rebase on main and add a short description of the change in CHANGELOG.MD

LGTM otherwise

@spicyPug02
Copy link
Contributor Author

CHANGELOG.md is updated with a description of the fix

@rafalp rafalp merged commit b5a67e1 into mirumee:main Feb 27, 2024
4 checks passed
@rafalp
Copy link
Contributor

rafalp commented Feb 27, 2024

Thank you for contributing!

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.

None yet

2 participants