refactor: split opencode runtime and tests #17
@@ -55,18 +55,6 @@ def default_reviewers() -> list[ReviewerSpec]:
|
||||
]
|
||||
|
||||
|
||||
def _coerce_str(v, default: str = "") -> str:
|
||||
return str(v).strip() if isinstance(v, (str, int, float)) else default
|
||||
|
||||
|
||||
def _coerce_int(v, default: int, lo: int, hi: int) -> int:
|
||||
try:
|
||||
n = int(v)
|
||||
except (TypeError, ValueError):
|
||||
return default
|
||||
return max(lo, min(hi, n))
|
||||
|
||||
|
||||
def parse_reviewers_config(raw: dict) -> list[ReviewerSpec]:
|
||||
|
masi marked this conversation as resolved
|
||||
"""Read `.pr-review.json:reviewers[]` into `list[ReviewerSpec]`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user
🟡 [MEDIUM] _coerce_str is defined twice in this module — lines 29-30 and lines 58-59. The second definition shadows the first with an identical implementation. Same applies to _coerce_int at lines 33-38 and 62-67. This is a merge artifact that leaves dead code and could confuse future maintainers about which definition is authoritative.
Fix: Remove the duplicate definitions at lines 58-67; keep the first definitions at lines 29-38.
🪙 ~9,003 (9.0K) tok (100% · attributed output)