terrajet icon indicating copy to clipboard operation
terrajet copied to clipboard

Make the generated file more explicit about their usage. (use a `.gen.go` extension)

Open remyleone opened this issue 2 years ago • 5 comments

What problem are you facing?

Having all files generated prefixed by zz_generated does not make it easier to understand what they are about when opened in a tree explorer.

How could Terrajet help solve your problem?

terrajet could generate files like .gen.go this convention is already followed by protobuf generator in go to make the distinction between generated files and hand written files.

remyleone avatar Feb 02 '22 12:02 remyleone

Hi @remyleone ! We're mostly following the convention of kubebuilder from upstream which uses that prefix for its generated files so that all generated files look similar 🙂

muvaf avatar Feb 02 '22 16:02 muvaf

One thing that was not clear is whether or not those files should be kept as it or should they be renamed/edited. What happen if I need to update the jet-generated files? Maybe it would be helpful to add in the header of those generated files if they should be deleted/edited/renamed. In particular it could be really helpful to have a small description/documentation at the top of the files that explain what they mean. I'm not sure to understand what are the differences between deepcopy, managed, managedlist, terraform, and types.

remyleone avatar Feb 02 '22 16:02 remyleone

Oh does that notice not appear in your generated files?

// Code generated by terrajet. DO NOT EDIT.

muvaf avatar Feb 03 '22 11:02 muvaf

It does appear but I don't understand what this generated code does or the purpose it got. A bit of documentation about why those files are needed and how they work together and interact with the rest of the provider could be useful.

remyleone avatar Feb 03 '22 13:02 remyleone

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 00:08 stale[bot]