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

thrift/thriftutil/enums: avoid duplicating underscores #72

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

xgoffin
Copy link
Contributor

@xgoffin xgoffin commented Jan 3, 2025

What does this PR do?

⚠️ NOTE: this is actually to patch the behaviour of the underlying CamelCaseToSnakeCase func. I could have put it in that func directly, however:

  • It's called CamelCaseToSnakeCase, and Camel Case does not accept underscores. It kind of makes sense that it'd cause issues with underscores then
  • If we start planning for underscores then, won't we have more bad surprises later on?
  • It makes more sense to patch its output in the thrift func where the case is not exactly respected imo

Can easily change it back if needs be

Fixes #

What are the observable changes?

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Properly labeled

Additional Notes

@xgoffin xgoffin self-assigned this Jan 3, 2025
@xgoffin xgoffin requested a review from a team as a code owner January 3, 2025 10:15
@xgoffin xgoffin requested review from Sypheos and pauloestrella1994 and removed request for a team January 3, 2025 10:15
Copy link

linear bot commented Jan 3, 2025

Copy link
Member

@Sypheos Sypheos left a comment

Choose a reason for hiding this comment

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

That's indeed something that changed overtime. We usually have have lower case letters in the enums now.

We could have a bunch of helpers that are not camelCaseToSnakeCase but more like SnakeCaseEnum that do indicate we don't assume the input format

@xgoffin xgoffin merged commit 5f0cb04 into master Jan 3, 2025
2 checks passed
@xgoffin xgoffin deleted the xg/DRA-2039/underscores branch January 3, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants