Skip to content
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

ci: settle on consistent style and add warnings for violation #4183

Merged
merged 7 commits into from
Oct 6, 2022

Conversation

jackgerrits
Copy link
Member

@jackgerrits jackgerrits commented Oct 4, 2022

I would like to propose we change the preferred type name style and then eventually enforce this in CI.

I propose we change from the most common style of snake_case for type names to PascalCase, and enforce snake_case for namespaces. Once the changes are made we can promote this clang-tidy warning into an error.

NOTE: functions and variables remain as snake_case

The primary motivator of changing types from snake_case to PascalCase is it allows variables and types to have separate style. Often it makes sense to name a variable similar to the type. e.g. vw::Example example; vs vw::example example;

Additionally, requires enum values and macros be UPPER_CASE.

See here for a report detailing changes required so we adhere to these checks:
https://gist.github.com/jackgerrits/c8da9db95457c372ad72c4fd72aff4b7#file-report-md

Resolution:
After discussion we will keep using the existing default of snake_case because there was opposition to change. Enforcing consistency will go ahead as planned.

Copy link
Collaborator

@olgavrou olgavrou left a comment

Choose a reason for hiding this comment

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

I like this as long as we don't introduce a breaking change in between minor releases (discussed offline, breaking change can be pushed back with aliasing)

@jackgerrits
Copy link
Member Author

100% agree on avoiding breaking changes here. Types which are considered part of the public API surface will have the necessary using x_old = x_new; put in place with a deprecated marker to avoid breaking changes and make it easier to migrate.

@jackgerrits jackgerrits enabled auto-merge (squash) October 6, 2022 20:44
@jackgerrits jackgerrits merged commit 3e17a89 into VowpalWabbit:master Oct 6, 2022
@jackgerrits jackgerrits deleted the naming_style branch October 6, 2022 20:49
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.

4 participants