Skip to content

Commit 03f3024

Browse files
authored
feat(init): deprecate --no-git flag, gate deprecations at v0.10.0 (#2357)
* feat(init): deprecate --no-git flag, gate deprecations at v0.10.0 - Add deprecation warning when --no-git is used on specify init - Update --ai deprecation gate from 1.0.0 to 0.10.0 - Update test expectation for the new version gate Closes #2167 * 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 * fix: strengthen --no-git deprecation test assertions Add assertions unique to the --no-git message ('will be removed', 'git extension will no longer be enabled by default') to prevent false positives from the --ai deprecation panel.
1 parent aad7b16 commit 03f3024

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _build_ai_deprecation_warning(
127127
ai_commands_dir=ai_commands_dir,
128128
)
129129
return (
130-
"[bold]--ai[/bold] is deprecated and will no longer be available in version 1.0.0 or later.\n\n"
130+
"[bold]--ai[/bold] is deprecated and will no longer be available in version 0.10.0 or later.\n\n"
131131
f"Use [bold]{replacement}[/bold] instead."
132132
)
133133

@@ -1088,6 +1088,13 @@ def init(
10881088
'use [bold]--integration generic --integration-options="--commands-dir <dir>"[/bold] instead.[/dim]'
10891089
)
10901090

1091+
if no_git:
1092+
console.print(
1093+
"[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n"
1094+
"[yellow]The git extension will no longer be enabled by default "
1095+
"— use the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]"
1096+
)
1097+
10911098
if project_name == ".":
10921099
here = True
10931100
project_name = None # Clear project_name to use existing validation logic

tests/integrations/test_cli.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_ai_emits_deprecation_warning_with_integration_replacement(self, tmp_pat
112112
assert "--ai" in normalized_output
113113
assert "deprecated" in normalized_output
114114
assert "no longer be available" in normalized_output
115-
assert "1.0.0" in normalized_output
115+
assert "0.10.0" in normalized_output
116116
assert "--integration copilot" in normalized_output
117117
assert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps")
118118
assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists()
@@ -446,6 +446,33 @@ 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+
assert "will be removed" in normalized_output
474+
assert "git extension will no longer be enabled by default" in normalized_output
475+
449476
def test_git_extension_commands_registered(self, tmp_path):
450477
"""Git extension commands are registered with the agent during init."""
451478
from typer.testing import CliRunner

0 commit comments

Comments
 (0)