fix: add --quiet/--json CLI flags, fix Claude Code hooks template#100
fix: add --quiet/--json CLI flags, fix Claude Code hooks template#100gzenz wants to merge 1 commit intotirth8205:mainfrom
Conversation
|
fixes #97 |
c514e1a to
15db376
Compare
- Add -q/--quiet flag to build, update, and status commands - Add --json flag to status command for machine-readable output - Fix generate_hooks_config() to use correct Claude Code schema: nested "hooks" arrays with "type": "command" on each entry - Replace invalid PreCommit hook event with PreToolUse + if: "Bash(git commit*)" filter - Update docs and tests to match
15db376 to
1270c80
Compare
…h8205#103 Combine nested hooks format from tirth8205#100 with permissions and enrich hook from tirth8205#103. Rename PreCommit -> PreToolUse, use nested hooks arrays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tirth8205
left a comment
There was a problem hiding this comment.
The hook schema fix portion overlaps with PR #141 (which we're prioritizing since it's more focused). The --quiet/--json CLI flags are useful but would conflict with PR #152 which just removed references to those flags from hook commands.
Suggestion: could you split out just the --quiet/--json flag additions into a separate PR? The hook fix portion is covered by #141.
Review: PR #100 — fix: add --quiet/--json CLI flags, fix Claude Code hooks templateThis PR is superseded by PR #158, which incorporates the --quiet/--json flags and the hooks template fix, plus the entire body of improvements. The owner's review noted that the hook schema fix overlaps with another PR (#141, which was prioritized), and the --quiet/--json flags would conflict with PR #152. Given that #158 is the consolidated replacement from the same author, there is no need to split this further. Recommendation: Close this PR in favor of #158. |
|
Superseded by #158. |
Summary
-q/--quietflag tobuild,update, andstatusCLI commands to suppress stdout output--jsonflag tostatuscommand for machine-readable outputgenerate_hooks_config()to produce valid Claude Codesettings.jsonschema:"hooks": [{"type": "command", ...}]structure (was flat, missing"type")PreCommithook event withPreToolUse+if: "Bash(git commit*)"filter"matcher"field to all hook entriesContext
The
hooks/hooks.json(MCP plugin path) had the correct Claude Code schema from day one, butgenerate_hooks_config()inskills.py(used bycode-review-graph init) was generating an invalid flat structure. The--quietand--jsonflags referenced in the template also didn't exist. This meant anyone usingcode-review-graph initgot a brokensettings.json.Test plan
ruff checkpassesuv run pytest tests/ --tb=short -q)code-review-graph update --quietproduces no output (exit 0)code-review-graph status --jsonoutputs valid JSONcode-review-graph build --quietproduces no output