Skip to content

refactor: remove targeted clippy exceptions - #11524

Merged
jdx merged 1 commit into
agent/refactor-interactive-rendererfrom
agent/refactor-clippy-targeted-exceptions
Jul 30, 2026
Merged

jdx merged 1 commit into
agent/refactor-interactive-rendererfrom
agent/refactor-clippy-targeted-exceptions

Conversation

@jdx

@jdx jdx commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • return process statuses through ExitCode instead of calling the disallowed std::process::exit
  • rename enum variants so they satisfy Clippy without suppressions
  • normalize seccomp syscall constants across integer widths
  • use an async-aware mutex in the brew test that holds a guard across await
  • remove six targeted Clippy exclusions and fix the uncovered mise-shim warnings

Validation

  • mise run lint
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test -p mise-shim -p vfox --all-features (91 passed, 2 ignored)
  • cargo test --all-features test_manager_repairs_linked_record_without_repouring

This is a prerequisite refactor in stack #11523; it targets #11522.

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Low Risk
Behavioral change is mainly exit path ordering (destructors run before exit); exit codes and shell activation semantics are preserved.

Overview
This PR clears several Clippy suppressions by adjusting how binaries exit, renaming a few enums, and tightening test synchronization.

Process exit: mise, mise-shim, and vfox no longer call std::process::exit. They return ExitCode from main (with exit::status replacing exit::terminate), so teardown can run before the process ends.

Naming: ActivatePrelude variants drop the Env suffix (Set, Prepend, MovePrepend), and the completion CLI shell enum uses Powershell instead of PowerShell, removing enum_variant_names allowances.

Other: Seccomp rule keys use a small syscall_number helper instead of a conversion lint allow. Brew pour tests switch from std::sync::Mutex to tokio::sync::Mutex with blocking_lock / .await so the async test can hold the env lock across await without a clippy exception.

Reviewed by Cursor Bugbot for commit 479c2ea. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 03e0bc83-a8f1-4e65-9610-ad510b7e431d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Comment thread src/exit.rs
pub fn status(code: i32) -> std::process::ExitCode {
debug!("exiting with code: {code}");
std::process::exit(code)
std::process::ExitCode::from(code as u8)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Exit status is truncated

When a Windows child returns a status outside 0..=255, casting the requested i32 status to u8 changes it before returning it to the OS, causing values such as 256 to be reported as success instead of preserving the child process failure.

Knowledge Base Used: CLI Dispatch Flow

Fix in Claude Code

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This refactor removes targeted Clippy exceptions while preserving command cleanup through returned exit codes.

  • Replaces direct process termination with ExitCode returns in mise, mise-shim, and vfox.
  • Renames shell and completion enum variants.
  • Normalizes seccomp syscall integer widths.
  • Uses Tokio's mutex in brew tests that hold the lock across awaits.

Confidence Score: 4/5

This PR is not yet safe to merge because both the main executable and standalone shim can misreport native Windows failure statuses.

The main exit helper still casts requested i32 statuses to u8, and the newly refactored shim independently applies the same narrowing to its child status; values such as 256 therefore become successful status 0.

Files Needing Attention: src/exit.rs and crates/mise-shim/src/main.rs

Important Files Changed

Filename Overview
src/exit.rs Replaces direct termination with an ExitCode conversion, but the previously reported status narrowing remains.
src/main.rs Returns process statuses only after runtime shutdown and command-scope cleanup.
crates/mise-shim/src/main.rs Refactors shim errors and child-status forwarding into a returned ExitCode, but narrows native Windows statuses.
crates/vfox/src/bin.rs Returns standard success or failure codes instead of directly terminating.
src/sandbox/seccomp.rs Normalizes architecture-dependent syscall constants through a generic i64 conversion.
src/shell/mod.rs Renames activation prelude variants without changing their dispatch behavior.
src/system/packages/brew/pour.rs Replaces the test environment lock with an async-aware Tokio mutex.

Fix All in Claude Code

Reviews (2): Last reviewed commit: "refactor: remove targeted clippy excepti..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▂▂▁▆▆█▆██▇▇█▇▇█▆▃▆ 84,685,231 → 84,885,376 +0.24% 31.26 → 18.64ms -40.38%
hook-env ▄▃▃▇▇█▆███▇▇█▇▇▇▁▁ 87,057,131 → 87,094,864 +0.04% 26.40 → 19.97ms -24.38%
ls ▄▆▁▄▅█▃▅▅▇▅▆▆▆▆▄▅▄ 76,709,887 → 76,689,697 -0.03% 21.20 → 16.37ms -22.76%
registry ▇▅▃▇▇█▅█▇██▇█▆▆▅▁▂ 50,102,060 → 50,117,821 +0.03% 14.46 → 11.26ms -22.13%
startup ▇█▃▇▇▇▆▆▆▇▇▆▇▅▆▅▁▁ 15,941,779 → 15,939,182 -0.02% 11.62 → 8.34ms -28.27%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

479c2ea04d49 vs 1581ac06d458 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/refactor-clippy-targeted-exceptions branch from 69471d6 to 479c2ea Compare July 30, 2026 23:20

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 479c2ea. Configure here.

Comment thread src/exit.rs
pub fn status(code: i32) -> std::process::ExitCode {
debug!("exiting with code: {code}");
std::process::exit(code)
std::process::ExitCode::from(code as u8)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows child exit codes truncated

Medium Severity

Replacing std::process::exit with ExitCode::from(code as u8) narrows propagated statuses to eight bits. On Windows, std::process::exit previously forwarded the full i32 from mise exec and shims; values above 255 (or wrapped negatives) can now report the wrong process status, including mapping some failures to 0.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 479c2ea. Configure here.

});
fn main() -> ExitCode {
match run() {
Ok(code) => ExitCode::from(code as u8),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Shim exit status is truncated

When a Windows tool launched through an executable mise shim returns a status outside 0..=255, casting the status to u8 changes it before forwarding it. A status of 256 therefore becomes 0, causing the failed shimmed command to be reported as successful.

Knowledge Base Used: Shims

Fix in Claude Code

@jdx
jdx merged commit b1cba04 into main Jul 30, 2026
31 checks passed
@jdx
jdx deleted the agent/refactor-clippy-targeted-exceptions branch July 30, 2026 23:56
jdx added a commit that referenced this pull request Jul 30, 2026
## Summary
- group aqua minisign inputs in a typed verification context
- group GitHub attestation inputs in a public request type
- encapsulate Homebrew dependency traversal state
- remove four backend and sigstore `clippy::too_many_arguments`
exclusions

## Validation
- `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- `cargo test -p mise-sigstore` (26 passed)
- `cargo test --all-features backend::aqua::tests` (52 passed)
- `cargo test --all-features system::packages::brew` (139 passed)

This is a prerequisite refactor in stack #11523; it targets #11524.

*AI-assisted — Tool: Codex; model: unavailable/unavailable; version:
unavailable.*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Mechanical signature refactors with existing test coverage; no
intended changes to verification or install resolution logic.
> 
> **Overview**
> Refactors several **long-argument** call sites into typed context
structs so Clippy’s `too_many_arguments` allow-list can be dropped
without changing behavior.
> 
> **mise-sigstore** introduces public **`GithubAttestationRequest`** and
routes GitHub attestation verification (including the base-URL + digest
path) through it; **`src/github/sigstore.rs`** is updated to build that
struct at the digest-aware call site.
> 
> **Aqua** minisign verification now takes a **`MinisignCheck`** bundle
(artifact, package, config, optional checksum, download dir, progress)
instead of eight separate parameters at each **`run_minisign_check`**
call.
> 
> **Homebrew formula resolution** replaces the recursive **`visit`**
helper’s many parameters with a **`VisitContext`** that holds traversal
state for dependency sorting.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1dd6171. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

1 participant