Sort repeat_read's imports and keep its sed range's names apart

This commit is contained in:
2026-10-28 12:44:18 +01:00
parent 2d3ec3a636
commit 1d2f3d14d2
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -40,8 +40,8 @@ from rule_hook.call import applied, Call, FILE_TOOLS, parsed_call, text
from rule_hook.rules import Breach, check, Checked, command_breaches, file_breaches, rules_help
from git_command import commits
from failure import Failure
from rule_hook.repeat_read import repeat_breaches
from rule_hook.override_log import Log, log_path, logged, print_overrides, write_override
from rule_hook.repeat_read import repeat_breaches
from rule_hook.reviewer_report import report_breaches
from rule_hook.reviewer_rung import reviewer_breaches
from shell_command import simple_commands
+4 -4
View File
@@ -5,9 +5,9 @@ Lines are in context when earlier reads' results show each of them, as the file
import dataclasses
import re
from claude_code.entries import parse_entry, part_text, parts
from rule_hook.call import Call, text
from rule_hook.rules import Breach
from rule_hook.call import Call, text
from claude_code.entries import parse_entry, part_text, parts
from shell_command import resolved, simple_commands
# The lines a Read without a limit returns.
@@ -57,8 +57,8 @@ def asked_lines(tool: object, given: object, cwd: str, home: str) -> Asked | Non
if name == "head" and (counted := HEAD_COUNT.fullmatch(" ".join(options) or "-10")):
return Asked(path, 1, int(counted.group(1)))
if name == "sed" and len(options) == 2 and options[0] == "-n" and (ranged := SED_RANGE.fullmatch(options[1])):
first, last = ranged.groups()
return Asked(path, int(first), None if last == "$" else int(last or first))
start, end = ranged.groups()
return Asked(path, int(start), None if end == "$" else int(end or start))
return None
+1 -1
View File
@@ -12,12 +12,12 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from rule_hook.rules import blocks, Breach, check, command_breaches, file_breaches, overrides
from rule_hook.main import breaches_of
from rule_hook.call import Call, parsed_call
from rule_hook.repeat_read import repeat_breaches
from git_command import Commit, commit_message, commits
from test_rank_todo import DECISIONS, README, TODO
from test_env import isolated_env
from model_routing import ladder
from rule_hook.override_log import LogLine, parsed_entry, this_chunks
from rule_hook.repeat_read import repeat_breaches
from rule_hook.reviewer_rung import reviewer_breaches
from rule_hook.git import git as rule_hook_git
from model_routing.ladder import Rung