Skip to content

fix(tauri): resolve macOS-gated clippy -D warnings blocking pre-push (#5018) - #5020

Merged
senamakel merged 6 commits into
tinyhumansai:mainfrom
oxoxDev:fix/5018-macos-clippy-warnings
Jul 18, 2026
Merged

fix(tauri): resolve macOS-gated clippy -D warnings blocking pre-push (#5018)#5020
senamakel merged 6 commits into
tinyhumansai:mainfrom
oxoxDev:fix/5018-macos-clippy-warnings

Conversation

@oxoxDev

@oxoxDev oxoxDev commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR — merge order (bottom → top)

  1. fix(tauri): resolve macOS-gated clippy -D warnings blocking pre-push (#5018) #5020 — macOS clippy fix (base main) ← this PR, unblocks all macOS pushes
  2. refactor(core): relocate the web chat conduit out of channels/ (#5002) #5004 — web_chat conduit relocation
  3. gates-off smoke lane — voice asserts + test-exec step (to be opened)
  4. fix(learning): email-signature subscriber + rebuild trigger silently depend on channels being configured #5003 — learning channels-coupling fix (to be opened)
  5. feat(core): feature gate — channels & webviews #4801 — channels feature gate (top, last child of epic Feature gates for core subsystems — tracking (lightweight harness builds) #4795)

This is position 1/5 — the base of the stack. Merge first; everything above carries these commits.


Summary

Fixes the 11 clippy -D warnings errors in the macOS-gated Tauri shell code that block git push on every macOS dev machine since #4872 wired pnpm rust:clippy into the pre-push hook. Six mechanical lint fixes, one commit per file.

Problem

#4872 (chore(rust): enforce warning-free clippy, merged 2026-07-16) switched .husky/pre-push from rust:check to rust:clippy, linting both crates with -D warnings. The app/src-tauri (shell) crate carries 11 pre-existing clippy errors, all inside #[cfg(target_os = "macos")] code.

The Rust Quality CI job runs on ubuntu-22.04, where every macOS-gated region is configured out before clippy sees it — so these errors are invisible to CI. Main is green; every macOS contributor is hard-blocked at push. (The CI blind-spot itself is tracked in #5019.)

The errors are pre-existing, not introduced here: this branch is cut fresh from upstream/main and every fix targets code untouched since #4872.

Solution

File Lint Fix
lib.rs:1198,1261,1280 needless_return ×3 Drop return/; in the cfg(macos) command tails (the cfg(not(macos)) sibling is stripped on macOS, so the block is the tail expression)
claude_code.rs:46 needless_return Same, in the macOS Terminal-launch arm
native_notifications/mod.rs:40,54 needless_return ×2 Same, in the macOS permission commands
imessage_scanner/mod.rs:375 manual_contains !ignored_markers.iter().any(|m| trimmed == *m)!ignored_markers.contains(&trimmed)
mascot_native_window.rs:55 dead_code #[allow(dead_code)] + comment on the webview field — not deletion
mascot_native_window.rs:392 explicit_auto_deref &*webview&webview (explicit &AnyObject annotation kept)
notch_window.rs:64 dead_code Delete is_open — zero callers
notch_window.rs:265 explicit_auto_deref &*webview&webview

Two judgment calls, flagged for review:

  • MascotPanel.webview — allow, not delete. The struct doc says it "holds the panel + webview together so we keep both alive." The field is an RAII keep-alive; dropping it deallocates the WKWebView and blanks the mascot panel. Deleting it would be a real behaviour bug, so it gets #[allow(dead_code)] and a comment saying why.
  • notch_window::is_open — delete. Zero callers (only mascot_native_window::is_open is used, at lib.rs:1226). pub(crate) and trivially re-addable. Keeping dead code "for symmetry" is how it accretes.

The vendored tauri-runtime-cef crate's 13 warnings are out of scope-D warnings applies only to the selected package, not path dependencies, so they do not block the push and are not regressions.

Submission Checklist

  • N/A: no new behaviour — these are mechanical lint fixes to existing code paths, so there is no new happy or failure path to cover. The two explicit_auto_deref and one manual_contains fixes are semantically identical to the originals.
  • N/A: no executable logic changed — every edit removes a diagnostic (return keyword, redundant deref, dead fn) or swaps an equivalent idiom. diff-cover has no new behaviour to measure.
  • N/A: no feature rows added, removed, or renamed.
  • N/A: no matrix feature IDs affected.
  • No new external network dependencies introduced.
  • N/A: no release-cut surface behaviour changes — macOS runtime behaviour is byte-identical (RAII keep-alive preserved, tail expressions return the same values).
  • Linked issue closed via Closes in ## Related.

Impact

  • Platform: macOS shell only. Runtime behaviour identical — the fixes remove diagnostics, not logic.
  • User-visible: none.
  • Binary size: unchanged.
  • Migration/compat: none.
  • Observability: none.
  • Security: none.
  • Risk: low. Verified by pnpm rust:clippy exiting 0 on macOS (was 11 errors) and cargo fmt --check clean. The explicit_auto_deref fixes touch objc2 coercion feeding raw-pointer msg_send! casts — mitigated by keeping the explicit &AnyObject type annotation so the coercion target is unchanged, plus a runtime smoke of the mascot/notch windows.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

Commit & Branch

  • Branch: fix/5018-macos-clippy-warnings

Validation Run

  • N/A: pnpm --filter openhuman-app format:check — no frontend files changed
  • N/A: pnpm typecheck — no TypeScript changed
  • Rust clippy (the acceptance test): GGML_NATIVE=OFF pnpm rust:clippy → exit 0 (was 11 errors on upstream/main)
  • Rust fmt: cargo fmt --manifest-path app/src-tauri/Cargo.toml --check clean
  • Pre-existing proof: git diff upstream/main..HEAD --name-only on the base contains none of the 6 lint files; introducing commit d320c4382 (chore(rust): enforce warning-free clippy #4872) predates this branch

@oxoxDev
oxoxDev requested a review from a team July 17, 2026 15:55
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR applies clippy fixes across macOS-gated Rust code, updates native window panel handling, simplifies iMessage marker filtering, and preserves existing platform-specific behavior.

Changes

Rust lint and native window cleanup

Layer / File(s) Summary
MacOS expression-return cleanup
app/src-tauri/src/claude_code.rs, app/src-tauri/src/lib.rs, app/src-tauri/src/native_notifications/mod.rs
MacOS-specific branches replace explicit return statements with expression-valued blocks.
Native window lifetime and hiding
app/src-tauri/src/mascot_native_window.rs, app/src-tauri/src/notch_window.rs
The retained webview references are formed directly, the mascot webview lifetime is documented, and notch hiding takes and orders out the stored panel.
IMessage marker filtering
app/src-tauri/src/imessage_scanner/mod.rs
Ignored marker detection uses contains while retaining exact-match behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #5019 — Updates macOS-gated Rust files with the clippy fixes described by the issue.

Suggested labels: bug

Suggested reviewers: codeghost21, senamakel

Poem

I nibbled the clippy warnings away,
While panels hide at end of day.
Webviews rest, retained and bright,
Markers filter cleanly tonight.
Rust hops onward, tidy and light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses the listed macOS-only lint errors and follows the requested mechanical fixes, including keeping the RAII webview field.
Out of Scope Changes check ✅ Passed No unrelated functionality or scope creep is evident; the edits are limited to lint-driven control-flow and ownership cleanups.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main change: fixing macOS-gated Clippy warnings blocking pre-push.

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

macOS pre-push blocked: 11 clippy -D warnings errors in macOS-gated shell code

2 participants