Split numbers embedded in non-snake-case words#2
Open
Conversation
Reasoning: - Numbers in camelCase (e.g. camelCase123) in C are usually translated to defines by splitting them first (e.g. BYTE_SIZE_CAMEL_CASE_123). - This split is not always sensible however. If a message is named MyMessage_mk2, the user has implicitly expressed that "mk" and "2" belong together, making "BYTE_SIZE_MY_MESSAGE_MK_2" an unintuitive result. An underscore can therefore be treated as an explicit choice. - This alone can result in inconsistencies in places where "UPPER_SNAKE_CASE" is used (e.g. enum values and constants). If an enum value named "TI82_PLUS" results in "ti82_plus", "TI82" should not result in "ti_82". Therefore, uppercase words should also be exempt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasoning:
"_" in wordcondition.In other words: if the user breaks convention, assume they have a reason for it. This includes:
MyMessage_v1,myMessage_v1->my_message_v1)my_value1,MY_VALUE1->my_value_v1)