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

Update snake_case regex #59

Merged
merged 2 commits into from
Jun 5, 2023
Merged

Update snake_case regex #59

merged 2 commits into from
Jun 5, 2023

Conversation

johnstairs
Copy link
Member

Changing the tokenization used to convert PascalCased and camelCased identifiers to snake_case.

In particular, numbers will be separated by an underscore, unless preceded by an uppercase. So kspaceEncodeStep1 becomes kspace_encode_step_1 instead of kspace_encode_step1.

@johnstairs johnstairs requested a review from hansenms June 2, 2023 22:20
Copy link
Contributor

@hansenms hansenms left a comment

Choose a reason for hiding this comment

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

This looks good.

@hansenms
Copy link
Contributor

hansenms commented Jun 3, 2023

There are some test failures, that I think will need a bit of adjustment, but in general the regex is right now.

@johnstairs
Copy link
Member Author

@hansenms yeah the test failures are for fields named e.g. int32Field which now become int_32_field which is a bit unfortunate, but I suppose not a common case.

@johnstairs johnstairs merged commit 0d00f46 into main Jun 5, 2023
11 checks passed
@johnstairs johnstairs deleted the johnstairs/snake_case_regex branch June 5, 2023 12:21
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