fix: normalize build context component paths#101
Conversation
rng1995
left a comment
There was a problem hiding this comment.
Correct fix — Path.as_posix() yields forward-slash relative paths on every OS, which is what these dict keys and SARIF/URI locations need, and it's behavior-preserving on Linux/macOS. Approving.
Minor / optional (non-blocking): this appears to fully overlap with PR #87, which makes the identical change to the same lines in build_context.py and the same test helpers (and adds short explanatory comments). Only one of the two can merge cleanly. Maintainers may want to pick one and close the other to avoid a conflict — no change needed to the code itself.
|
Thank you so much for this contribution, @nyxst4ck! 🙏 We're going to close this PR in favor of #87, which makes the identical The underlying issue (#86) is fully resolved by the merged change, so your fix and #87's are functionally equivalent — you both correctly identified and solved the same problem. We really appreciate you taking the time to dig in and send a fix, and we'd love to see more contributions from you in the future. Thanks again! 🚀 |
Summary
Path.as_posix()so Windows emits forward-slash relative paths.Test Plan
python -m compileall -q src\skillspector\nodes\build_context.py tests\test_mcp_least_privilege.py tests\test_mcp_tool_poisoning.py tests\nodes\test_semantic_quality_policy.py tests\nodes\analyzers\test_semantic_security_discovery.py tests\nodes\analyzers\test_semantic_developer_intent.pygit diff --checkNote: full pytest collection was not run locally because this machine only has Python 3.11, while the project requires Python >=3.12.
Fixes #86