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

Allow --prefix option or replacement regex option #78

Open
vlad opened this issue May 18, 2019 · 1 comment
Open

Allow --prefix option or replacement regex option #78

vlad opened this issue May 18, 2019 · 1 comment

Comments

@vlad
Copy link

vlad commented May 18, 2019

I'd like to provide a --prefix , such that a Template structure in thrift could be named CG_Alpha_Template. In that example, --prefix "CG_Alpha_" helps label it as "CG" as code-gen and "Alpha" as the service name.

Historically, all fields in our back-end service thrift files are optional and the front-end defines a new flow type for just the necessary fields. On top of that, two thrift files may have identical type names. Therefore, Template type can actually be the name of four unique types (4) in a particular project.

Instead, it would be nice if the four unique types had four different names so they are easily searchable by "_Template" or "Alpha_Template", but actually named:

  • CG_Alpha_Template vs CG_Zeta_Template in flow type code-gen
  • Alpha_Template vs Zeta_Template in our own types that are a subset of code-gen

The renaming could also be done as part of post-processing in the code-gen CLI that uses this thrift2flow library. The code-gen CLI would need some changes whether it passes a --prefix or does post-processing, so I'm also opening an issue there.

Please let me know what you think! Thank you.

@vlad vlad changed the title Allow --prefix option Allow --prefix option or replacement regex option May 18, 2019
@ardok
Copy link

ardok commented May 28, 2019

Would love this as well.
Say I have Foo and Bar service.
I would like everything from foo.thrift to be prepended with Foo.
Like: FooUUID, FooSomeType, FooResponseType.
Same goes for Bar.

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

No branches or pull requests

2 participants