Add a header to .clang-tidy that explains why certain rules are disabled.
If we indeed decide to keep the bugprone-integer-division Clang-Tidy rule
disabled, this means there are two categories of disabled rules:
- Not yet enabled, because no developer has spent time on it, and
- intentionally disabled.
Here are some example diffs to illustrate those annoying fixes:
+ const int half_unit_y = UI_UNIT_Y / 2;
const int drag_threshold = min_ii(
WM_event_drag_threshold(event),
- (int)((UI_UNIT_Y / 2) * ui_block_to_window_scale(data->region, but->block)));
+ (int)(half_unit_y * ui_block_to_window_scale(data->region, but->block)));- const float margin_y = DRAG_MULTINUM_THRESHOLD_DRAG_Y / sqrtf(block->aspect); + const float margin_y = (float)(DRAG_MULTINUM_THRESHOLD_DRAG_Y) / sqrtf(block->aspect);
- const float xco = x + w / 2 + 0.5f; - const float yco = y + h / 2 + 0.5f; + const float xco = x + (int)(w / 2) + 0.5f; + const float yco = y + (int)(h / 2) + 0.5f;