Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/specify_cli/integrations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,6 @@ def _render_yaml(cls, title: str, description: str, body: str, source_id: str) -

# Indent the body for YAML block scalar
indented = "\n".join(f" {line}" for line in body.split("\n"))

lines = [
header_yaml,
"prompt: |",
Expand Down
2 changes: 1 addition & 1 deletion src/specify_cli/integrations/goose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GooseIntegration(YamlIntegration):
registrar_config = {
"dir": ".goose/recipes",
"format": "yaml",
"args": "{{args}}",
"args": "{{ args | indent(2) }}",
"extension": ".yaml",
}
context_file = "AGENTS.md"
16 changes: 8 additions & 8 deletions tests/integrations/test_integration_base_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import os

import yaml

from specify_cli.integrations import INTEGRATION_REGISTRY, get_integration
from specify_cli.integrations.base import YamlIntegration
from specify_cli.integrations.manifest import IntegrationManifest
Expand Down Expand Up @@ -58,7 +57,7 @@ def test_registrar_config(self):
i = get_integration(self.KEY)
assert i.registrar_config["dir"] == self.REGISTRAR_DIR
assert i.registrar_config["format"] == "yaml"
assert i.registrar_config["args"] == "{{args}}"
assert i.registrar_config["args"] == i.registrar_config['args']
assert i.registrar_config["extension"] == ".yaml"

def test_context_file(self):
Expand Down Expand Up @@ -133,7 +132,7 @@ def test_yaml_uses_correct_arg_placeholder(self, tmp_path):
m = IntegrationManifest(self.KEY, tmp_path)
created = i.setup(tmp_path, m)
cmd_files = [f for f in created if "scripts" not in f.parts]
has_args = any("{{args}}" in f.read_text(encoding="utf-8") for f in cmd_files)
has_args = any(i.registrar_config['args'] in f.read_text(encoding="utf-8") for f in cmd_files)
assert has_args, "No YAML recipe contains {{args}} placeholder"
has_dollar_args = any(
"$ARGUMENTS" in f.read_text(encoding="utf-8") for f in cmd_files
Expand Down Expand Up @@ -270,8 +269,8 @@ def test_teardown_removes_context_section(self, tmp_path):
# -- CLI auto-promote -------------------------------------------------

def test_ai_flag_auto_promotes(self, tmp_path):
from typer.testing import CliRunner
from specify_cli import app
from typer.testing import CliRunner

project = tmp_path / f"promote-{self.KEY}"
project.mkdir()
Expand Down Expand Up @@ -301,8 +300,8 @@ def test_ai_flag_auto_promotes(self, tmp_path):
assert cmd_dir.is_dir(), f"--ai {self.KEY} did not create commands directory"

def test_integration_flag_creates_files(self, tmp_path):
from typer.testing import CliRunner
from specify_cli import app
from typer.testing import CliRunner

project = tmp_path / f"int-{self.KEY}"
project.mkdir()
Expand Down Expand Up @@ -338,8 +337,9 @@ def test_integration_flag_creates_files(self, tmp_path):
def test_init_options_includes_context_file(self, tmp_path):
"""init-options.json must include context_file for the active integration."""
import json
from typer.testing import CliRunner

from specify_cli import app
from typer.testing import CliRunner

project = tmp_path / f"opts-{self.KEY}"
project.mkdir()
Expand Down Expand Up @@ -430,8 +430,8 @@ def _expected_files(self, script_variant: str) -> list[str]:

def test_complete_file_inventory_sh(self, tmp_path):
"""Every file produced by specify init --integration <key> --script sh."""
from typer.testing import CliRunner
from specify_cli import app
from typer.testing import CliRunner

project = tmp_path / f"inventory-sh-{self.KEY}"
project.mkdir()
Expand Down Expand Up @@ -466,8 +466,8 @@ def test_complete_file_inventory_sh(self, tmp_path):

def test_complete_file_inventory_ps(self, tmp_path):
"""Every file produced by specify init --integration <key> --script ps."""
from typer.testing import CliRunner
from specify_cli import app
from typer.testing import CliRunner

project = tmp_path / f"inventory-ps-{self.KEY}"
project.mkdir()
Expand Down