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

Converting snake_case_modules into CamelCaseModules #405

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

film42
Copy link
Member

@film42 film42 commented Oct 10, 2019

This is an implementation to fix #403

Although this is mostly a straight-forward conversion, this is a breaking change. We might be able to stuff this change behind a feature flag, but it might be better to wait for a major version upgrade.

I did find an example that was a little weird and makes me not want to merge this change. If you look at google_unittest.proto:

  optional group OptionalGroup_extension = 16 {
    optional int32 a = 17;
  }
...
  repeated group RepeatedGroup_extension = 46 {
    optional int32 a = 47;
  }

These use a half camel-case half snake-case name for the group extension. This new change now converts this into a full camel-case class:

  class OptionalGroupExtension
    optional :int32, :a, 17
  end
...
  class RepeatedGroupExtension
    optional :int32, :a, 47
  end
...
    optional ::ProtobufUnittest::OptionalGroupExtension, :".protobuf_unittest.optionalgroup_extension", 16, :extension => true
...
    repeated ::ProtobufUnittest::RepeatedGroupExtension, :".protobuf_unittest.repeatedgroup_extension", 46, :extension => true

And that might be a little weird, but if we are going to make a breaking change here, it might be worth it? I suppose we could see if everything up until the snake-case edition is camel-case, and if so, leave it be?

cc @liveh2o @abrandoned

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.

Generate module name: snake_case to CamelCase in case of package name.
1 participant