From 3391e5ded0757638d6e79b56baa16714137ba709 Mon Sep 17 00:00:00 2001 From: Hannes Suhr Date: Wed, 13 May 2026 23:42:58 +0200 Subject: [PATCH] style: fix 6 mh_style violations across PR scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI lint job revealed 6 style issues in mh_style libs/ tests/ examples/: - DashboardEngine.m:80 165-char comment (pre-existing 260513-q7w fu2) - DashboardToolbar.m:316 && continuation (pre-existing) - FastSenseWidget.m:454 && continuation (pre-existing) - TestClearPanelHelper_.m:1 class naming scheme violation (PR scope) - test_event_pick_mode.m:411 && continuation (PR scope) - test_event_pick_mode.m:418 && continuation (PR scope) Resolutions: - Wrap the 165-char comment as a 3-line block above the property. - Replace `...\n && expr` with `&& ...\n expr` (operator at end of previous line per MISS_HIT operator_after_continuation rule). - Rename TestClearPanelHelper_ -> TestClearPanelHelper (file + class declaration + 2 callsites in tests/test_create_event_dialog.m). After fixes: `mh_style libs/ tests/ examples/` reports "465 file(s) analysed, everything seems fine". Drive-by fixes for the 3 pre-existing issues are included because the CI job lints the whole tree on every push — without them, this PR's lint stays red regardless of my own files being clean. 12/12 test_event_pick_mode + 9/9 test_create_event_dialog still PASS. Co-Authored-By: Claude Opus 4.7 (1M context) --- libs/Dashboard/DashboardEngine.m | 5 ++++- libs/Dashboard/DashboardToolbar.m | 4 ++-- libs/Dashboard/FastSenseWidget.m | 4 ++-- tests/{TestClearPanelHelper_.m => TestClearPanelHelper.m} | 4 ++-- tests/test_create_event_dialog.m | 2 +- tests/test_event_pick_mode.m | 8 ++++---- 6 files changed, 15 insertions(+), 12 deletions(-) rename tests/{TestClearPanelHelper_.m => TestClearPanelHelper.m} (86%) diff --git a/libs/Dashboard/DashboardEngine.m b/libs/Dashboard/DashboardEngine.m index 79d8a1db..2849a48d 100644 --- a/libs/Dashboard/DashboardEngine.m +++ b/libs/Dashboard/DashboardEngine.m @@ -77,7 +77,10 @@ SliderDebounceTimer = [] % MATLAB timer for coalescing rapid slider events ResizeDebounceTimer = [] % MATLAB timer for coalescing rapid resize events (260513-q7w) ResizeFinalRedrawTimer = [] % Longer-period backstop timer: unconditional rerenderWidgets after resize fully settles (260513-q7w fu) - IsRerendering_ = false % true while rerenderWidgets is in flight — suppresses spurious resize-timer scheduling that the panel teardown/recreate cascade would otherwise trigger (260513-q7w fu2) + % 260513-q7w fu2: true while rerenderWidgets is in flight — suppresses + % spurious resize-timer scheduling that the panel teardown/recreate + % cascade would otherwise trigger. + IsRerendering_ = false TimeRangeSelector_ = [] % TimeRangeSelector handle (replaces dual sliders) % [tStart tEnd] cache of most recent broadcast (260508-llw); used by % switchPage to re-apply the current synced window to widgets that diff --git a/libs/Dashboard/DashboardToolbar.m b/libs/Dashboard/DashboardToolbar.m index d2392b9a..687f76dd 100644 --- a/libs/Dashboard/DashboardToolbar.m +++ b/libs/Dashboard/DashboardToolbar.m @@ -312,8 +312,8 @@ function applyFollowToWidgets_(obj, widgets, mode, snap) continue; end if isa(w, 'FastSenseWidget') - if ~isempty(w.FastSenseObj) && isvalid(w.FastSenseObj) ... - && w.FastSenseObj.IsRendered + if ~isempty(w.FastSenseObj) && isvalid(w.FastSenseObj) && ... + w.FastSenseObj.IsRendered try w.FastSenseObj.setViewMode(mode); if snap diff --git a/libs/Dashboard/FastSenseWidget.m b/libs/Dashboard/FastSenseWidget.m index 5060134b..77c093a7 100644 --- a/libs/Dashboard/FastSenseWidget.m +++ b/libs/Dashboard/FastSenseWidget.m @@ -450,8 +450,8 @@ function autoScaleY_(obj, y) if obj.UserZoomedY return; end - if ~isempty(obj.FastSenseObj) && isvalid(obj.FastSenseObj) ... - && strcmp(obj.FastSenseObj.LiveViewMode, 'follow') + if ~isempty(obj.FastSenseObj) && isvalid(obj.FastSenseObj) && ... + strcmp(obj.FastSenseObj.LiveViewMode, 'follow') return; end if isempty(obj.FastSenseObj) || ~obj.FastSenseObj.IsRendered diff --git a/tests/TestClearPanelHelper_.m b/tests/TestClearPanelHelper.m similarity index 86% rename from tests/TestClearPanelHelper_.m rename to tests/TestClearPanelHelper.m index 6b9bd983..b59bffd4 100644 --- a/tests/TestClearPanelHelper_.m +++ b/tests/TestClearPanelHelper.m @@ -1,4 +1,4 @@ -classdef TestClearPanelHelper_ < DashboardWidget +classdef TestClearPanelHelper < DashboardWidget %TESTCLEARPANELHELPER_ Minimal DashboardWidget subclass used by % tests/test_create_event_dialog.m to drive the % `clearPanelControls` protected-static through a real subclass. @@ -24,7 +24,7 @@ function refresh(~) methods (Static) function run(hp) %RUN Expose the protected clearPanelControls static for tests. - TestClearPanelHelper_.clearPanelControls(hp); + TestClearPanelHelper.clearPanelControls(hp); end end end diff --git a/tests/test_create_event_dialog.m b/tests/test_create_event_dialog.m index 5268f466..71ebc2cf 100644 --- a/tests/test_create_event_dialog.m +++ b/tests/test_create_event_dialog.m @@ -301,7 +301,7 @@ function add_create_event_dialog_path() function clear_panel_controls_via_subclass_(hp) %CLEAR_PANEL_CONTROLS_VIA_SUBCLASS_ Drive DashboardWidget.clearPanelControls % via a lightweight subclass that exposes the protected static. - TestClearPanelHelper_.run(hp); + TestClearPanelHelper.run(hp); end function safe_close_(h) diff --git a/tests/test_event_pick_mode.m b/tests/test_event_pick_mode.m index fac131a4..6d0fff73 100644 --- a/tests/test_event_pick_mode.m +++ b/tests/test_event_pick_mode.m @@ -407,15 +407,15 @@ function add_test_path_() function teardown_(engine, fs) %TEARDOWN_ Per-handle delete; never close all force. try - if ~isempty(fs) && ~isempty(fs.hEventDetails_) ... - && ishandle(fs.hEventDetails_) + if ~isempty(fs) && ~isempty(fs.hEventDetails_) && ... + ishandle(fs.hEventDetails_) delete(fs.hEventDetails_); end catch end try - if ~isempty(engine) && ~isempty(engine.hFigure) ... - && ishandle(engine.hFigure) + if ~isempty(engine) && ~isempty(engine.hFigure) && ... + ishandle(engine.hFigure) delete(engine.hFigure); end catch