Skip to content

fix: drop double screenpipe- prefix in lefthook clippy hook#4001

Merged
louis030195 merged 1 commit into
screenpipe:mainfrom
pleasedodisturb:fix/lefthook-clippy-double-prefix
Jun 11, 2026
Merged

fix: drop double screenpipe- prefix in lefthook clippy hook#4001
louis030195 merged 1 commit into
screenpipe:mainfrom
pleasedodisturb:fix/lefthook-clippy-double-prefix

Conversation

@pleasedodisturb

Copy link
Copy Markdown

description

The rust-clippy pre-commit hook in lefthook.yml never passes: crate directories under crates/ are already named screenpipe-*, so the hook's sed 's|crates/||' already yields the full package name (e.g. screenpipe-core). The loop then re-prefixes it, producing nonexistent package ids like screenpipe-screenpipe-core, and cargo clippy exits 101 ("did not match any packages") on every commit that stages a crate .rs file.

One-line fix: pass the bare extracted name to -p.

related issue: none open — found while setting up the local dev loop (hooks installed via bunx lefthook install).

before

(terminal output instead of a recording — this is a git-hook config change, no app UI involved)

$ cargo clippy -p "screenpipe-screenpipe-core" --all-targets -- -W clippy::all
error: package ID specification `screenpipe-screenpipe-core` did not match any packages
# exit 101 → the clippy gate fails on any staged crates/**.rs file

after

$ cargo clippy -p "screenpipe-core" --all-targets -- -W clippy::all
    Finished `dev` profile [unoptimized + debuginfo] target(s)
# hook passes; ~1s warm for a typical staged set

how to test

  1. bunx lefthook install
  2. stage any crate file, e.g. touch crates/screenpipe-core/src/lib.rs && git add crates/screenpipe-core/src/lib.rs
  3. bunx lefthook run pre-commit — on main, rust-clippy fails with exit 101 ("did not match any packages"); with this patch it resolves the real package and runs clippy

desktop app checklist (if applicable)

n/a — no tauri commands or exported Rust types touched (git-hook config only).

Crate directories under crates/ are already named screenpipe-*, so the
sed in the rust-clippy hook already yields the full package name
(e.g. screenpipe-core). Re-prefixing it produced nonexistent package
ids like screenpipe-screenpipe-core, so cargo clippy exited 101
("did not match any packages") on every commit that staged a crate
.rs file — the clippy gate could never pass.

Use the bare extracted name instead. Verified: cargo pkgid -p
screenpipe-screenpipe-core fails, cargo pkgid -p screenpipe-core
resolves, and the corrected hook command runs clippy cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@louis030195 louis030195 marked this pull request as ready for review June 11, 2026 14:23
@louis030195 louis030195 merged commit 5a168d0 into screenpipe:main Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants