reconstant icon indicating copy to clipboard operation
reconstant copied to clipboard

possible improvements: 1. common comments 2. python enums inherit int

Open TonyYanOnFire opened this issue 2 years ago • 5 comments
trafficstars

There are two improvements that would be very beneficial:

  1. Support for common comments. Currently, every file has an autogenerated comment "# autogenerated by reconstant - do not edit!". I have to modify each file to add common comments, which is time-consuming.
  2. Enable Python enums to inherit int. By doing so, the enums generated by reconstant can work seamlessly with pydantic, as described in the pydantic docs here.

I would love to hear your thoughts on these improvements.

TonyYanOnFire avatar Feb 23 '23 06:02 TonyYanOnFire

Hey, both of those sound useful. I'm working on https://github.com/robusta-dev/robusta full-time these days and don't have much capacity for reconstant, but if you open a PR I'd be happy to merge both improvements.

aantn avatar Mar 01 '23 08:03 aantn

OK. I’ll see what I can do

TonyYanOnFire avatar Mar 02 '23 04:03 TonyYanOnFire

@aantn hey natan, I've implemented these features. Would you review my PR? If necessary, I can submit another PR to update readme after this one is merged

TonyYanOnFire avatar Mar 12 '23 10:03 TonyYanOnFire

@TonyYanOnFire thanks, a few comments below:

  1. For the common comment, the PR adds something by default that most people will want to remove. Can we set the commen by default to autogenerated by reconstant - do not edit! and you'll be able to customize that with your own string?

  2. For the enum, please inherit from IntEnum instead of int and enum.

aantn avatar Apr 02 '23 15:04 aantn

@aantn sounds great

TonyYanOnFire avatar Apr 12 '23 13:04 TonyYanOnFire