-
Notifications
You must be signed in to change notification settings - Fork 27
Add clang-format to pre-commit #448
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
base: master
Are you sure you want to change the base?
Conversation
f5cf735 to
0f6f763
Compare
cb4bca4 to
51e9ede
Compare
51e9ede to
5e55672
Compare
5e55672 to
adfc0ba
Compare
| * and so can update it without creating and setting a new image, or not. */ | ||
| bool can_update = state_image.is_valid() && state_image->get_size() == region.get_size() | ||
| && state_image->get_format() == source_image->get_format(); | ||
| * and so can update it without creating and setting a new image, or not. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep operators at the start of a line.
That's way easier to read than at the end of a line.
In the current version it's clearly a && b.
In your proposed version b is just floating there without context.
wvpm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
I approve of the snake_case and import changes.
The rest is either worse or as good/bad as before.
Examples of regression include:
- ternary operator formatting
var =with nothing behind it- operators at the end of line
957297c to
cbb44f6
Compare
Add SConstruct and SCsub to ruff/ruff-format pre-commit Standardize header consistency: dependency headers should include with `<...>` local headers should include with `"..."` Standardize GDCLASS terminated with a semicolon Replace camelCase variable names with snake_case
cbb44f6 to
31aed9a
Compare
| progress_texture = Utilities::make_solid_colour_texture( | ||
| progress_colour, progress_bar->get_size().x, progress_bar->get_size().y | ||
| ); | ||
| progress_texture = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(copied)
This line break doesn't make sense.
var = should never be a thing.
Always keep something after the =.
The current/old version is better.
| range_limit_max_rect.position[axis] = slider_start | ||
| + slider_distance * _value_to_ratio(upper_range_limit.value_or(step_count)) | ||
| + slider_rect.size[axis] / 2.0f; | ||
| range_limit_max_rect.position[axis] = slider_start + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep operators at the start of a line.
That's way easier to read than at the end of a line.
In the current version it's clearly a + b + c.
In your proposed version b is just floating there without context.
| min_value = gui_scrollbar->get_min_value(), | ||
| step_size = gui_scrollbar->get_step_size() | ||
| ](const int32_t val)->int32_t { | ||
| auto adjust_for_min_and_step_size // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting a line with = looks awful.
The current/old version is good.
Add SConstruct and SCsub to ruff/ruff-format pre-commit
Standardize header consistency:
<...>"..."Standardize GDCLASS terminated with a semicolon
Replace camelCase variable names with snake_case