From 389e39012dd4e039b6fa16427c012cbd333ef28c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 2 Jun 2026 13:49:34 +0000 Subject: [PATCH] style(baseline): typehint call-return locals in CalculatorRebaseliner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR feedback: annotate locals assigned from a method-call return or attribute access, even though pyright infers them — the type is visible at the assignment without chasing the callee. `result: SapResult` and `sap_version: Optional[float]` in rebaseline(). Local annotations are not evaluated at runtime, so the TYPE_CHECKING-only SapResult import stands. Co-Authored-By: Claude Opus 4.8 --- domain/property_baseline/calculator_rebaseliner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domain/property_baseline/calculator_rebaseliner.py b/domain/property_baseline/calculator_rebaseliner.py index cbfaace7..c6519c83 100644 --- a/domain/property_baseline/calculator_rebaseliner.py +++ b/domain/property_baseline/calculator_rebaseliner.py @@ -59,8 +59,8 @@ class CalculatorRebaseliner(Rebaseliner): ) -> tuple[Performance, RebaselineReason]: # A raise (UnmappedSapCode, etc.) propagates: the calculator is # load-bearing, so the batch aborts and the cert is fixed at once. - result = self._calculator.calculate(effective_epc) - sap_version = effective_epc.sap_version + result: SapResult = self._calculator.calculate(effective_epc) + sap_version: Optional[float] = effective_epc.sap_version if sap_version is not None and sap_version < _SAP10_2_FLOOR: return performance_from_sap_result(result), "pre_sap10" self._log_divergence(