🐛 fix(sync): keep agents block blank lines
This commit is contained in:
@@ -101,6 +101,30 @@ langs = ["tsl"]
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertTrue(agents_index.is_file())
|
||||
|
||||
def test_sync_standards_agents_block_has_blank_lines(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
config_body = f"""
|
||||
[playbook]
|
||||
project_root = "{tmp_dir}"
|
||||
|
||||
[sync_standards]
|
||||
langs = ["tsl"]
|
||||
"""
|
||||
config_path = Path(tmp_dir) / "playbook.toml"
|
||||
config_path.write_text(config_body, encoding="utf-8")
|
||||
|
||||
result = run_cli("-config", str(config_path))
|
||||
self.assertEqual(result.returncode, 0)
|
||||
|
||||
agents_md = Path(tmp_dir) / "AGENTS.md"
|
||||
lines = agents_md.read_text(encoding="utf-8").splitlines()
|
||||
start_idx = lines.index("<!-- playbook:agents:start -->")
|
||||
end_idx = lines.index("<!-- playbook:agents:end -->")
|
||||
block = lines[start_idx : end_idx + 1]
|
||||
self.assertEqual(block[1], "")
|
||||
bullet_idx = next(i for i, line in enumerate(block) if line.startswith("- "))
|
||||
self.assertEqual(block[bullet_idx - 1], "")
|
||||
|
||||
def test_install_skills(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
target = Path(tmp_dir) / "codex"
|
||||
|
||||
Reference in New Issue
Block a user