Skip to content

fix FIELD_NUMBERS_ORDER_ASCENDING rule. enums could starts from 0 #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

frolovo22
Copy link

@frolovo22 frolovo22 commented Aug 21, 2025

Fix for FIELD_NUMBERS_ORDER_ASCENDING rule. Enums could starts from 0. Added tests for that
New rules:

enum Size {
            /// its ok. Enum could starts from 0. fixed
            SIZE_SMALL_UNSPECIFIED = 0;
            SIZE_MEDIUM = 1;
            SIZE_LARGE = 2;
} 

enum Size {
            /// its not ok. Rule added
            SIZE_SMALL_UNSPECIFIED = -1;
            SIZE_MEDIUM = 1;
            SIZE_LARGE = 2;
} 

message Size {
            /// its not ok. For messages number should be positive integer. Rule added
            string size = 0;
} 

message Size {
            /// its not ok. For messages number should be positive integer. Rule added
            string size = -1;
} 

Copy link
Owner

@yoheimuta yoheimuta left a comment

Choose a reason for hiding this comment

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

Thanks!

@yoheimuta yoheimuta merged commit ad3fbe1 into yoheimuta:master Aug 21, 2025
6 checks passed
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.

2 participants