| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
… diff Adds snapshot-pre-bash.sh (PreToolUse Bash) + track-bash-writes.sh (PostToolUse Bash): the pre-hook captures git status --porcelain to a per-worktree temp file before each Bash call; the post-hook diffs the before/after state and appends newly modified or created files to .claude/session-edits.log. This closes the gap where files written by sed -i, printf redirects, tee, heredocs, or build tools (Cargo.lock, lockfiles) were never recorded, causing guard-git.sh to emit false-positive BLOCKED errors. Closes #1457
- clojure.rs: annotate lifetime-anchor assignment to silence false-positive - cfg.rs: remove never-called start_line_of method - complexity.rs: remove never-constructed NotHandled variant; convert irrefutable if-let patterns to plain let destructures - dataflow.rs: remove never-read callee fields from CallReturn/Destructured - incremental.rs: remove never-read lang field from CacheEntry cargo check and cargo clippy both clean after these changes.
|
Claude finished @carlos-alm's task —— View job PR Review: chore(native): clean up pre-existing Rust dead-code warnings
⚠️ Scope Concern: This PR Contains 5 Independent ConcernsThe PR title and description say "remove Rust dead-code warnings," but the branch contains 5 distinct commits touching different layers:
Per CLAUDE.md: "One PR = one concern." This PR bundles unrelated changes that each deserve their own PR. The review below covers all of them. Phase 1: Root Cause AnalysisRust dead code (commit 85a26df): All five removals are genuine dead code fixes — the compiler's warnings are being addressed correctly, not suppressed:
Root cause is correctly identified and fixed in each case. No underlying issue is being hidden. Phase 2: Configuration Change Detection (HIGH SCRUTINY)Two new hook scripts were added in commit 9a52c7c: snapshot-pre-bash.sh (PreToolUse/Bash):
track-bash-writes.sh (PostToolUse/Bash):
settings.json change: Wires both hooks into PreToolUse/Bash and PostToolUse/Bash. The new entries follow the existing pattern. No rules are relaxed. Test file change (visitor.test.ts): Removes a // biome-ignore lint/suspicious/noExplicitAny comment. This is correct — the suppression was flagged as unused (biome reports this), so removing it cleans up a stale comment. The any annotation on let parse: any remains. Test assertions are unchanged. ✓ Phase 3: Test Integrity
Phase 4: Code Qualitycomplexity.rs: The NotHandled variant removal + if let → let conversion is idiomatic. Single-variant enums should use plain let. The result compiles to identical machine code. dataflow.rs: LocalSource::CallReturn and LocalSource::Destructured variants lose their unnamed fields. The find_binding match at line 909-914 still pattern-matches on discriminant only — behavior is identical. clojure.rs: The #[allow(unused_assignments)] annotation is placed at the correct granularity (the specific let mut statement, not the entire function). The comment above it explaining the borrow-lifetime reason is clear and accurate. incremental.rs: CacheEntry loses the lang: LanguageKind field. Confirmed the field was set in the constructor but never accessed. The parse_file method still correctly calls lang.tree_sitter_language() using the local variable — clean. Phase 5: Backlog Compliance
Critical Concerns
Final Assessment## Root Cause Analysis Problem Being Solved: Remove 6 pre-existing Rust dead-code warnings from `cargo check`. Why This Approach: Correct — each warning is addressed at source, not suppressed globally. Risk Assessment: Low for the Rust changes. The bundled hook feature is more behavioral. ## Backlog Compliance - Zero-dep: ✓ - Foundation-aligned: ✓ - Problem-fit: 2/5 — maintenance work, not AI-navigation - Breaking: No - Tier: 1 ## Critical Concerns 1. Mixed PR — 5 unrelated commits (Rust cleanup + new hook feature + SKILL.md fix + gitignore + test cleanup) 2. Bash hook fast-path regex false-skip on compound commands (low, informational-only) 3. Space-in-path double-logging in track-bash-writes.sh (low, tolerable) ## Final Recommendation - Rating: ⭐⭐⭐ (3/5) - Action: APPROVE WITH CONDITIONS - Reasoning: The Rust dead-code removals are clean and correct. The clojure.rs lifetime-anchor annotation is properly scoped and justified. The hook changes are sound in principle but belong in their own PR per the project's own one-concern-per-PR rule. The two minor hook bugs (fast-path regex, space-in-path) are tolerable given informational-only semantics, but worth fixing. Recommend merging after either (a) splitting the hook feature into a separate PR, or (b) accepting the mixed PR given the low risk of the bundled changes. |
Sorry, something went wrong.
Codegraph Impact Analysis7 functions changed → 123 callers affected across 32 files
|
Sorry, something went wrong.
Greptile SummaryThis PR eliminates six pre-existing dead-code compiler warnings across five files without changing any runtime behaviour. All removals and suppressions are correct and the diff is internally consistent.
Confidence Score: 5/5Safe to merge — all changes are dead-code removals with no runtime behaviour affected. Every change either deletes an unreachable variant/field/method or suppresses a lint for a variable that is genuinely load-bearing. The irrefutable let conversion in complexity.rs is correct because classify_branch exhaustively returns the sole remaining variant, and the three dataflow.rs call sites are all consistently updated after the field removal. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cargo check / clippy warnings] --> B{Warning type}
B -->|unused method| C[cfg.rs\nRemove start_line_of]
B -->|unused variant| D[complexity.rs\nRemove NotHandled\nif let → let]
B -->|unused struct fields| E[dataflow.rs\nRemove callee fields\nUpdate 3 call sites + match arms]
B -->|unused struct field| F[incremental.rs\nRemove lang field\nUpdate insert site]
B -->|unused assignment| G[clojure.rs\nAdd allow attribute\nwith explanatory comment]
C --> H[Zero warnings]
D --> H
E --> H
F --> H
G --> H
Reviews (6): Last reviewed commit: "chore: merge origin/main into chore/rust..." | Re-trigger Greptile |
Sorry, something went wrong.
…urce variants
CallReturn and Destructured became unit variants when their callee fields
were removed. The find_binding match arms still used { .. } struct-pattern
syntax which implies ignored fields where none exist. Simplify to plain
unit patterns.
|
Fixed — simplified the stale struct-pattern syntax in find_binding's match arms: LocalSource::CallReturn { .. } and LocalSource::Destructured { .. } are now plain unit patterns (LocalSource::CallReturn / LocalSource::Destructured) to match the updated enum definition. See commit 33423f0. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Addressed Claude's feedback: the stale struct-pattern syntax in find_binding's match arms was fixed in commit 33423f0 — LocalSource::CallReturn { .. } and LocalSource::Destructured { .. } are now plain unit variants to match the updated fieldless enum definition. The other observations (mixed PR scope, hook minor concerns) are noted; the relevant scope concerns were mitigated by having the hooks changes land in a separate PR (#1483) while the Rust dead-code changes remain in this one. |
Sorry, something went wrong.
Resolves add/add conflicts in .claude/hooks/snapshot-pre-bash.sh and .claude/hooks/track-bash-writes.sh by taking main's version, which includes the concurrent-safe per-command hash keying introduced in #1483.
|
Resolved merge conflict from the #1483 overlap: both branches added the same two hook scripts (.claude/hooks/snapshot-pre-bash.sh and .claude/hooks/track-bash-writes.sh) independently, causing an add/add conflict. Resolved by taking main's version from #1483, which includes the concurrent-safe per-command-hash keying. The Rust dead-code changes are unaffected. See merge commit a6e50da. |
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Removes 6 pre-existing dead-code warnings from cargo check:
cargo check and cargo clippy both produce zero warnings after these changes.
Closes #1456