Skip to content

Commit c0aa9c9

Browse files
committed
fix: address additional CodeRabbit review comments
- Fix dry-run file count to report actual file count regardless of mode - Add explicit UTF-8 encoding when writing generated files - Fix single-element tuple in test detection_dirs - Move prompts directory from packages to force-include in pyproject.toml
1 parent ce5e36e commit c0aa9c9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ spec-driven-development-mcp = "server:main"
3636
sdd-generate-commands = "slash_commands.cli:main"
3737

3838
[tool.hatch.build.targets.wheel]
39-
packages = ["mcp_server", "prompts", "slash_commands"]
39+
packages = ["mcp_server", "slash_commands"]
4040

4141
[tool.hatch.build.targets.wheel.force-include]
4242
"server.py" = "server.py"
4343
"__version__.py" = "__version__.py"
44+
"prompts/" = "prompts/"
4445

4546

4647
# --- Ruff (linter + formatter) ---

slash_commands/writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def generate(self) -> dict[str, Any]:
120120

121121
return {
122122
"prompts_loaded": len(prompts),
123-
"files_written": sum(1 for f in files if not self.dry_run),
123+
"files_written": len(files),
124124
"files": files,
125125
"prompts": [{"name": p.name, "path": str(p.path)} for p in prompts],
126126
"backups_created": self._backups_created,
@@ -178,7 +178,7 @@ def _generate_file(self, prompt: MarkdownPrompt, agent: AgentConfig) -> dict[str
178178

179179
# Write file if not dry run
180180
if not self.dry_run:
181-
output_path.write_text(content)
181+
output_path.write_text(content, encoding="utf-8")
182182

183183
return {
184184
"path": str(output_path),

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def test_cli_interactive_agent_selection_selects_all(mock_prompts_dir, tmp_path)
316316
command_dir=".cursor/commands",
317317
command_format=CommandFormat.MARKDOWN,
318318
command_file_extension=".md",
319-
detection_dirs=(".cursor"),
319+
detection_dirs=(".cursor",),
320320
),
321321
]
322322

0 commit comments

Comments
 (0)