yoheimuta / protolint

A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
MIT License
576 stars 51 forks source link

Bug: Enum field prefix naming rule #351

Closed LucasVinicius314 closed 1 year ago

LucasVinicius314 commented 1 year ago

Hey there,

I've had the following enum description for 2 months now, that was previously accepted just fine by protolint, up to v0.46.0.

enum ListAccountPipedriveOAuthsEnabledFilter {
  LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_UNSPECIFIED = 0;
  LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_ENABLED = 1;
  LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_DISABLED = 2;
}

Since the last version, v0.46.1, that changed the naming rules, I started getting the following error:

[pipedrive/pipedrive.proto:100:3] EnumField name "LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_UNSPECIFIED" should have the prefix "LIST_ACCOUNT_PIPEDRIVEO_AUTHS_ENABLED_FILTER"
[pipedrive/pipedrive.proto:101:3] EnumField name "LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_ENABLED" should have the prefix "LIST_ACCOUNT_PIPEDRIVEO_AUTHS_ENABLED_FILTER"
[pipedrive/pipedrive.proto:102:3] EnumField name "LIST_ACCOUNT_PIPEDRIVE_OAUTHS_ENABLED_FILTER_DISABLED" should have the prefix "LIST_ACCOUNT_PIPEDRIVEO_AUTHS_ENABLED_FILTER

This naming rule behaviour seems to have been introduced on v0.46.1, breaking a few previously valid prefixes.

Could we get a fix for this? Thanks a lot in advance.

yoheimuta commented 1 year ago

@LucasVinicius314 Thank you for letting me know! I'm addressing this regression.

yoheimuta commented 1 year ago

@LucasVinicius314 I've just released v0.46.2: https://github.com/yoheimuta/protolint/releases/tag/v0.46.2. Can you give it a try? Thanks!

LucasVinicius314 commented 1 year ago

@yoheimuta Just tested it, it's working now. Thanks a lot!