feat: claude code runner (#9)

This commit is contained in:
banteg
2026-01-01 17:04:49 +04:00
committed by GitHub
parent 4885e3b878
commit 936ea5109b
30 changed files with 2259 additions and 382 deletions
+21
View File
@@ -0,0 +1,21 @@
from __future__ import annotations
from pathlib import Path
from takopi.utils.paths import relativize_command
def test_relativize_command_rewrites_cwd_paths(tmp_path: Path) -> None:
base = tmp_path / "repo"
base.mkdir()
command = f'find {base}/tests -type f -name "*.py" | head -20'
expected = 'find tests -type f -name "*.py" | head -20'
assert relativize_command(command, base_dir=base) == expected
def test_relativize_command_rewrites_equals_paths(tmp_path: Path) -> None:
base = tmp_path / "repo"
base.mkdir()
command = f'rg -n --files -g "*.py" --path={base}/src'
expected = 'rg -n --files -g "*.py" --path=src'
assert relativize_command(command, base_dir=base) == expected