Skip to content

Conversation

@flrossetto
Copy link

  • Add new EnumConfig struct with annotation parsing capabilities
  • Implement annotation processing for per-enum configuration overrides
  • Support annotations like @marshal, @SQL, @Prefix, @nocase, @NoPrefix
  • Add example annotation enum with comprehensive test coverage
  • Update generator to respect annotation-based configuration
  • Maintain backward compatibility with existing enum definitions

- Add new EnumConfig struct with annotation parsing capabilities
- Implement annotation processing for per-enum configuration overrides
- Support annotations like @marshal, @SQL, @Prefix, @nocase, @NoPrefix
- Add example annotation enum with comprehensive test coverage
- Update generator to respect annotation-based configuration
- Maintain backward compatibility with existing enum definitions
@flrossetto flrossetto requested a review from abice as a code owner December 2, 2025 15:34
@abice
Copy link
Owner

abice commented Dec 16, 2025

Hey @flrossetto

I like the idea of adding per enum configuration, I've just bee too busy to give this a full review. I'll try to get to it over the holiday season! Thanks so much for spending time to improve the project.

@coveralls
Copy link

Coverage Status

coverage: 83.559% (-9.1%) from 92.662%
when pulling 4d5f6e7 on flrossetto:master
into 9d73c76 on abice:master.

)

// EnumConfigValue holds a configuration value with its validity flag.
type EnumConfigValue struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using interface here, I'd prefer seeing this as a generic implementation. I don't believe i'm supporting go versions older than 1.18 anymore, so I think it's ok to introduce this as

EnumConfigValue[T enumValue] {
Value T
Valid bool
}

With the enumValue being the interface to constrain it to a string or bool.

Is there something I'm missing that would make that invalid?

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

Successfully merging this pull request may close these issues.

3 participants