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
5 changes: 4 additions & 1 deletion src/skillspector/nodes/build_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def _walk_skill_files(skill_dir: Path) -> list[str]:
continue
try:
rel = item.relative_to(skill_dir)
paths.append(str(rel))
# Use forward slashes on every OS: these relative paths are dict keys
# and SARIF/URI locations, so they must be portable (not OS-specific
# backslashes on Windows).
paths.append(rel.as_posix())
except ValueError:
logger.debug("Skipping path (not under skill_dir): %s", item)
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/analyzers/test_semantic_developer_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def _build_file_cache(skill_dir: Path) -> dict[str, str]:
for item in sorted(skill_dir.rglob("*")):
if not item.is_file():
continue
rel = str(item.relative_to(skill_dir))
rel = item.relative_to(skill_dir).as_posix() # forward slashes on every OS
try:
cache[rel] = item.read_text(encoding="utf-8", errors="replace")
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/analyzers/test_semantic_security_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _build_file_cache(skill_dir: Path) -> dict[str, str]:
for item in sorted(skill_dir.rglob("*")):
if not item.is_file():
continue
rel = str(item.relative_to(skill_dir))
rel = item.relative_to(skill_dir).as_posix() # forward slashes on every OS
try:
cache[rel] = item.read_text(encoding="utf-8", errors="replace")
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/test_semantic_quality_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _build_file_cache(skill_dir: Path) -> dict[str, str]:
for item in sorted(skill_dir.rglob("*")):
if not item.is_file():
continue
rel = str(item.relative_to(skill_dir))
rel = item.relative_to(skill_dir).as_posix() # forward slashes on every OS
try:
cache[rel] = item.read_text(encoding="utf-8", errors="replace")
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mcp_least_privilege.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _make_state(fixture_name: str) -> dict:
continue
if item.name.startswith(".") and not item.name.startswith(".claude"):
continue
rel = str(item.relative_to(fixture_dir))
rel = item.relative_to(fixture_dir).as_posix() # forward slashes on every OS
components.append(rel)
components.sort()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_mcp_tool_poisoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _make_state(
continue
if item.name.startswith(".") and not item.name.startswith(".claude"):
continue
rel = str(item.relative_to(fixture_dir))
rel = item.relative_to(fixture_dir).as_posix() # forward slashes on every OS
components.append(rel)
components.sort()

Expand Down