Skip to content

Commit e55bd2f

Browse files
committed
fix: address PR review feedback
- Update --no-git deprecation message to reference existing 'specify extension' commands instead of non-existent --extension flag - Add test_no_git_emits_deprecation_warning CLI test
1 parent 211019e commit e55bd2f

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/specify_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ def init(
10921092
console.print(
10931093
"[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n"
10941094
"[yellow]The git extension will no longer be enabled by default "
1095-
"— use --extension git to opt in.[/yellow]"
1095+
"— use the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]"
10961096
)
10971097

10981098
if project_name == ".":

tests/integrations/test_cli.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,31 @@ def test_no_git_skips_extension(self, tmp_path):
446446
ext_dir = project / ".specify" / "extensions" / "git"
447447
assert not ext_dir.exists(), "git extension should not be installed with --no-git"
448448

449+
def test_no_git_emits_deprecation_warning(self, tmp_path):
450+
"""Using --no-git emits a visible deprecation warning."""
451+
from typer.testing import CliRunner
452+
from specify_cli import app
453+
454+
project = tmp_path / "no-git-warn"
455+
project.mkdir()
456+
old_cwd = os.getcwd()
457+
try:
458+
os.chdir(project)
459+
runner = CliRunner()
460+
result = runner.invoke(app, [
461+
"init", "--here", "--ai", "claude", "--script", "sh",
462+
"--no-git", "--ignore-agent-tools",
463+
], catch_exceptions=False)
464+
finally:
465+
os.chdir(old_cwd)
466+
467+
normalized_output = _normalize_cli_output(result.output)
468+
assert result.exit_code == 0, result.output
469+
assert "--no-git" in normalized_output
470+
assert "deprecated" in normalized_output
471+
assert "0.10.0" in normalized_output
472+
assert "specify extension" in normalized_output
473+
449474
def test_git_extension_commands_registered(self, tmp_path):
450475
"""Git extension commands are registered with the agent during init."""
451476
from typer.testing import CliRunner

0 commit comments

Comments
 (0)