fix: --platform target now filters skills, hooks, and instruction files (#133)#142
Conversation
|
@tirth8205 hey! could you review this when you get a chance? it fixes the platform filter for skills, hooks and instruction files (issue #133) |
352214d to
54216bb
Compare
|
@tirth8205 Rebased on latest main, CI is green. Ready to merge when you are! |
|
@tirth8205 up |
|
The code changes here are correct and well-tested — this is exactly the right fix for #133. However the branch now has a merge conflict with Please rebase on the latest One minor note: |
…es (tirth8205#133) Previously, 'code-review-graph install --platform cursor' still wrote CLAUDE.md, installed Claude Code hooks, and injected instructions into every platform rule file (AGENTS.md, GEMINI.md, .cursorrules, .windsurfrules), ignoring the selected target. - skills.py: inject_platform_instructions now takes a target param and filters files via an ownership map (AGENTS.md -> cursor/opencode/antigravity, GEMINI.md -> antigravity, .cursorrules -> cursor, .windsurfrules -> windsurf). Default 'all' preserves existing behavior. - cli.py _handle_init: inject_claude_md and install_hooks now only run when target is 'claude' or 'all'; target is passed to inject_platform_instructions. - tests: new TestInjectPlatformInstructionsFiltering covers all, default, claude, cursor, windsurf, antigravity, opencode targets.
54216bb to
5e063f7
Compare
|
Rebased on latest main and force-pushed. The conflict in |
Unreleased fixes since v2.2.2 that users are complaining about: - #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182, #188, #191, #201) — v2.2.2 generates an invalid hooks schema and timeouts in ms instead of seconds; PreCommit is also not a real event. - #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit transactions from the legacy sqlite3 default caused "cannot start a transaction within a transaction" on update. - #166 Go method receivers resolved from field_identifier. - #170 UTF-8 decode errors in detect_changes (fixes #169). - #142 --platform target filters (fixes #133). - #213 / #183 large-repo community detection hangs. - #220 CI lint + tomllib on Python 3.10. - #159 missing pytest-cov dev dep. - #154 JSX component CALLS edges. Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge, #215 recurse_submodules, #185 gitignore default (#175), #171 gitignore docs (#157). Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean, 691 tests pass, coverage 73.72%. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unreleased fixes since v2.2.2 that users are complaining about: - #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182, #188, #191, #201) — v2.2.2 generates an invalid hooks schema and timeouts in ms instead of seconds; PreCommit is also not a real event. - #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit transactions from the legacy sqlite3 default caused "cannot start a transaction within a transaction" on update. - #166 Go method receivers resolved from field_identifier. - #170 UTF-8 decode errors in detect_changes (fixes #169). - #142 --platform target filters (fixes #133). - #213 / #183 large-repo community detection hangs. - #220 CI lint + tomllib on Python 3.10. - #159 missing pytest-cov dev dep. - #154 JSX component CALLS edges. Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge, #215 recurse_submodules, #185 gitignore default (#175), #171 gitignore docs (#157). Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean, 691 tests pass, coverage 73.72%. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem
Running `code-review-graph install --platform cursor` (or any non-"all" target) still wrote Claude-specific files and every platform rule file, ignoring the flag:
This made `--platform` effectively cosmetic — the only thing it actually scoped was the MCP server config.
Fixes #133.
Fix
Default `target="all"` preserves existing behavior. `target="claude"` writes nothing (CLAUDE.md is handled separately).
Note: the fix does not remove stale files from prior runs — e.g. if a user ran with `--platform all` and later re-runs with `--platform cursor`, existing `GEMINI.md` / `.windsurfrules` stay on disk. Deleting user files silently felt unsafe; happy to revisit if you'd prefer a cleanup step.
Testing