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
This commit is contained in:
2026-04-30 17:13:25 +00:00
committed by Forgejo
parent b1140b073d
commit 89fc0724df
@@ -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), (