reconstant
reconstant copied to clipboard
possible improvements: 1. common comments 2. python enums inherit int
There are two improvements that would be very beneficial:
- 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.
- 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.
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.
OK. I’ll see what I can do
@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 thanks, a few comments below:
-
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? -
For the enum, please inherit from IntEnum instead of int and enum.
@aantn sounds great