Skip to content

Conversation

@Spartan322
Copy link
Member

@Spartan322 Spartan322 commented May 14, 2025

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

@Spartan322 Spartan322 force-pushed the add/formatting branch 4 times, most recently from cb4bca4 to 51e9ede Compare May 18, 2025 15:29
@Spartan322 Spartan322 added the salvageable Is old or out of date, but can be salvaged for potential merge label Jun 14, 2025
@Spartan322 Spartan322 added topic:codestyle and removed salvageable Is old or out of date, but can be salvaged for potential merge labels Jun 16, 2025
@Spartan322 Spartan322 marked this pull request as ready for review June 16, 2025 11:47
@Spartan322 Spartan322 changed the title Add clang-format Add clang-format to pre-commit Jun 16, 2025
* 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. */
Copy link
Contributor

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.

Copy link
Contributor

@wvpm wvpm left a 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

@Spartan322 Spartan322 force-pushed the add/formatting branch 2 times, most recently from 957297c to cbb44f6 Compare July 8, 2025 14:30
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
progress_texture = Utilities::make_solid_colour_texture(
progress_colour, progress_bar->get_size().x, progress_bar->get_size().y
);
progress_texture =
Copy link
Contributor

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 +
Copy link
Contributor

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 //
Copy link
Contributor

@wvpm wvpm Jul 8, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants