genny icon indicating copy to clipboard operation
genny copied to clipboard

Renaming Types after codegen

Open prateek opened this issue 5 years ago • 1 comments

Hey @mauricelam!

First, thank you for the work on the library. We really appreciate the work you've put into it.

We use it extensively for generating type aware collections like maps, slices and a lot more. It works great for our needs. Our biggest gripe with it is how we handle renaming of the generated types.

For example: (1) here's a maketarget for a map type: https://github.com/m3db/m3/blob/master/src/dbnode/generated-source-files.mk#L71-L81 (2) the make target for (1) uses a generic map generation target: https://github.com/m3db/m3/blob/master/src/x/generated-source-files.mk#L38-L45 (3) the make target for (2) also uses gorename to change the name of generated types: https://github.com/m3db/m3/blob/master/src/x/generated-source-files.mk#L56-L104

We'd really like to make the equivalent renaming natively part of the library. Would you be open merging something like that in? I'm happy to do the work you're up for it.

prateek avatar Apr 18 '19 02:04 prateek

Yes I think that would be a great idea! It would be great if we can have a flag that allows users to opt-in to this behavior though.

mauricelam avatar Apr 24 '19 04:04 mauricelam