Conversation
Clear the installer's share of the violations a stricter lint configuration later in this stack will enforce, while staying green under the current gates. Several API changes land here because the fixes require them: - `BaseDirs` methods drop their redundant suffixes (`home`, `executables`, `whitaker_data`); the external `UserDirs::home_dir` call inside the implementation keeps its own name; - `InstallArgs` regroups its flags into `lint_selection`, `execution`, and `skip` flatten structs, so no single struct carries an excess of booleans; - install metrics report integer permille rather than a float rate, so assertions compare exactly instead of within a tolerance; - test helpers that previously panicked (`LocalServer::start`, the fake-binary writers, `load_cargo_toml`, `extract_binstall_table`) return `Result` and let callers propagate; - parameters that were needlessly moved are taken by reference; - the repository-release install path moves to its own module, with its executor, tool, and dependency grouped into a `RepositoryInstallRequest` so the extraction stays within the argument budget; - the root check swaps `libc::geteuid` for `rustix`, removing the last `unsafe` block in the installer and the `libc` dependency with it. A `#[expect(clippy::cast_sign_loss)]` is removed rather than retained: the timestamp arithmetic it covered now uses `div_euclid`/`rem_euclid` and a checked conversion.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch clears the installer's share of the workspace-lint violations, staying green under the current gates while pre-emptively satisfying the stricter configuration landing later in the stack. Most of the diff is mechanical — checked indexing, by-reference parameters, descriptive errors in place of panics — but several API changes land here because the fixes require them, and they are the parts worth reviewing carefully.
Fifth PR in the lint-hardening stack, based on
harden-lint-support-crates.Review walkthrough
BaseDirstrait methods drop their redundant suffixes (home_dir→home,bin_dir→executables,whitaker_data_dir→whitaker_data). The externaldirectories_next::UserDirs::home_dir()call inside the implementation deliberately keeps its own name.LintSelectionFlags/ExecutionFlags/SkipFlagsclap flatten groups, so no single struct carries an excess of booleans; 36 call sites follow.install.rs, with executor, tool, and dependency grouped into aRepositoryInstallRequestso the extraction stays within the four-argument budget rather than trading one lint for another.unsafe { libc::geteuid() }forrustix::process::geteuid(), removing the lastunsafeblock in the installer — andlibcwith it.Validation
make check-fmt lint typecheck: pass.make lintrunscargo doc --workspace, which caught stale intra-doc links andno_rundoctests referring to the renamedBaseDirsmethods.make test: 1652/1652 passed, 5 skipped.Notes
#[expect(clippy::cast_sign_loss)]is removed rather than retained: the timestamp arithmetic it covered now usesdiv_euclid/rem_euclidand a checked conversion. No#[allow]or#[expect]is added anywhere in this branch.make markdownlintreports MD012 indocs/developers-guide.md; that is pre-existing on the parent branch and untouched here — its fix belongs to a PR above this one.References