From ec3a0bc6b8a4b9149358d949d55b7722dc539fee Mon Sep 17 00:00:00 2001 From: HAL9000 Date: Thu, 30 Apr 2026 17:13:25 +0000 Subject: [PATCH] format: reformat ca_continuous_pr_reviewer_steps.py to pass ruff format check CI lint job runs both ruff check and ruff format --check. The step definitions file for ca-continuous-pr-reviewer feature needed reformatting to satisfy the format check gate. ISSUES CLOSED: #3111 --- .../steps/ca_continuous_pr_reviewer_steps.py | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/features/steps/ca_continuous_pr_reviewer_steps.py b/features/steps/ca_continuous_pr_reviewer_steps.py index d0cf74b98..fe861ef6e 100644 --- a/features/steps/ca_continuous_pr_reviewer_steps.py +++ b/features/steps/ca_continuous_pr_reviewer_steps.py @@ -56,15 +56,11 @@ def _sort_prs_by_priority( if now_ts is None: now_ts = time.time() due_timestamps: list[float] = [ - pr["milestone_due_ts"] - for pr in prs - if pr.get("milestone_due_ts") is not None + pr["milestone_due_ts"] for pr in prs if pr.get("milestone_due_ts") is not None ] min_due = min(due_timestamps) if due_timestamps else 0.0 max_due = max(due_timestamps) if due_timestamps else 0.0 - scored = [ - (pr, _compute_priority_score(pr, min_due, max_due, now_ts)) for pr in prs - ] + scored = [(pr, _compute_priority_score(pr, min_due, max_due, now_ts)) for pr in prs] scored.sort(key=lambda x: x[1], reverse=True) return [pr for pr, _ in scored] @@ -246,14 +242,10 @@ def step_then_must_have_before_should_have(context: Context) -> None: sorted_prs = context.sorted_prs assert sorted_prs, "Expected a non-empty sorted PR list" must_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Must Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Must Have" ] should_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Should Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Should Have" ] if must_have_indices and should_have_indices: assert max(must_have_indices) < min(should_have_indices), ( @@ -269,14 +261,10 @@ def step_then_should_have_before_could_have(context: Context) -> None: sorted_prs = context.sorted_prs assert sorted_prs, "Expected a non-empty sorted PR list" should_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Should Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Should Have" ] could_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Could Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Could Have" ] if should_have_indices and could_have_indices: assert max(should_have_indices) < min(could_have_indices), (