Skip to content

Commit 120b3c2

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: reuse _is_valid_timeout helper for CLI --timeout validation
The _validate_run_options function was inlining the same timeout check that _is_valid_timeout already encapsulates. This aligns the two validation sites in cli.py so they use the same helper consistently. Also removes an unused `buffer` variable in test_agent.py flagged by ruff (F841). Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent f932017 commit 120b3c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ralphify/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def _validate_run_options(
429429
_exit_error(f"'-n' must be a positive integer, got {max_iterations}.")
430430
if not math.isfinite(delay) or delay < 0:
431431
_exit_error(f"'--delay' must be non-negative, got {delay}.")
432-
if timeout is not None and (not math.isfinite(timeout) or timeout <= 0):
432+
if timeout is not None and not _is_valid_timeout(timeout):
433433
_exit_error(f"'--timeout' must be a positive number, got {timeout}.")
434434

435435

0 commit comments

Comments
 (0)