Skip to content

Commit 2055453

Browse files
committed
fix: address remaining CodeRabbit AI review comments
- Fix coverage exclude pattern for __main__ guard in pyproject.toml - Add PackageNotFoundError handling for version fallback in generators.py - Store only basename in source_path to avoid leaking absolute paths - Fix agents=None to default to all supported agents in writer.py These changes address 4 remaining CodeRabbit AI review comments that were not covered in the previous fixes.
1 parent 41f7d23 commit 2055453

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ exclude_lines = [
8585
"def __repr__",
8686
"raise AssertionError",
8787
"raise NotImplementedError",
88-
"if __name__ == .__main__.:",
88+
"if __name__ == \"__main__\":",
8989
"if TYPE_CHECKING:",
9090
"class .*\\bProtocol\\):",
9191
"@(abc\\.)?abstractmethod",

slash_commands/generators.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
try:
1212
from __version__ import __version__
1313
except ImportError:
14-
# Fallback for when installed as a package
15-
from importlib.metadata import version
14+
# Fallback when installed as a package
15+
from importlib.metadata import PackageNotFoundError, version
1616

17-
__version__ = version("spec-driven-development-mcp")
17+
try:
18+
__version__ = version("spec-driven-development-mcp")
19+
except PackageNotFoundError:
20+
__version__ = "0.0.0"
1821

1922
from mcp_server.prompt_utils import MarkdownPrompt, PromptArgumentSpec
2023
from slash_commands.config import AgentConfig, CommandFormat
@@ -213,7 +216,8 @@ def _build_meta(self, prompt: MarkdownPrompt, agent: AgentConfig) -> dict:
213216
"command_format": agent.command_format.value,
214217
"command_file_extension": agent.command_file_extension,
215218
"source_prompt": prompt.name,
216-
"source_path": str(prompt.path),
219+
# Store only basename to avoid leaking absolute paths
220+
"source_path": prompt.path.name,
217221
"version": __version__,
218222
"updated_at": datetime.now(UTC).isoformat(),
219223
})

slash_commands/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
overwrite_action: Global overwrite action to apply. If None, will prompt per file.
8888
"""
8989
self.prompts_dir = prompts_dir
90-
self.agents = agents or []
90+
self.agents = agents if agents is not None else list_agent_keys()
9191
self.dry_run = dry_run
9292
self.base_path = base_path or Path.cwd()
9393
self.overwrite_action = overwrite_action

0 commit comments

Comments
 (0)