Skip to content

all: bump {cargo,flake} deps, fix clippy lints#619

Merged
NotAShelf merged 6 commits intomasterfrom
faukah/push-yryuqwzttuzy
Apr 18, 2026
Merged

all: bump {cargo,flake} deps, fix clippy lints#619
NotAShelf merged 6 commits intomasterfrom
faukah/push-yryuqwzttuzy

Conversation

@faukah
Copy link
Copy Markdown
Contributor

@faukah faukah commented Apr 14, 2026

Sanity Checking

  • I have read and understood the contribution guidelines
  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • Style and consistency
    • I ran nix fmt to format my Nix code
    • I ran cargo fmt to format my Rust code
    • I have added appropriate documentation to new code
    • My changes are consistent with the rest of the codebase
  • Correctness
    • I ran cargo clippy and fixed any new linter warnings.
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas to explain the
      logic
    • I have documented the motive for those changes in the PR body or commit
      description.
  • Tested on platform(s):
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

Summary by CodeRabbit

  • Refactor

    • Cleaned and simplified internal parsing and JSON handling for consistency; no user-facing behavior changes.
  • Chores

    • Upgraded a workspace dependency to v0.3.0.
    • Adjusted workspace lint configuration.
  • Tests

    • Relaxed certain static-analysis checks in test code to reduce noisy warnings during development.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Workspace dependency clap_mangen was bumped and a workspace Clippy lint was added; multiple small code refactors replaced branching with functional helpers, test modules gained explicit Clippy expect annotations, and minor formatting/lazy-evaluation tweaks were applied across several crates.

Changes

Cohort / File(s) Summary
Workspace & Cargo
Cargo.toml
Bumped workspace dependency clap_mangen from 0.2.31 to 0.3.0 and changed declaration to { features = ["env"], version = "0.3.0" }; added [workspace.lints.clippy] struct_excessive_bools = "allow".
Clippy lint attribute relocation
crates/nh-nixos/src/args.rs, Cargo.toml
Removed #[allow(clippy::struct_excessive_bools)] from OsRebuildArgs and added the same rule at workspace level.
Test modules — Clippy expectations & minor edits
crates/nh-core/src/checks.rs, crates/nh-core/src/installable.rs, crates/nh-core/src/util.rs
Added #[expect(...)] attributes to test modules/arms for clippy lints (e.g., expect_used, unwrap_used, panic, unreachable); minor test message reformatting and EnvGuard construction changed to Self { ... }.
Functional refactors / pattern changes
crates/nh-core/src/command.rs, crates/nh-nixos/src/generations.rs, crates/nh-home/src/home.rs
Replaced conditional branching with functional combinators (strip_prefix(...).map_or_else(...), json.as_array().map_or_else(...), unwrap_or_else(...)) to defer evaluation; behavior preserved.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: dependency bumps and Clippy lint fixes across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch faukah/push-yryuqwzttuzy

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 and usage tips.

Comment thread crates/nh-core/src/checks.rs Outdated
Comment thread crates/nh-core/src/util.rs Outdated
@faukah faukah force-pushed the faukah/push-yryuqwzttuzy branch 2 times, most recently from cdd0a11 to 291480a Compare April 15, 2026 15:40
@faukah faukah force-pushed the faukah/push-yryuqwzttuzy branch from 291480a to afcac1f Compare April 15, 2026 15:42
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Cargo.toml (1)

85-85: Replace the workspace-wide Clippy allow with local annotations on specific structs.

The workspace-wide struct_excessive_bools allow at line 85 suppresses this lint across all crates. However, only four structs actually have ≥4 bool fields:

  • NixBuildPassthroughArgs (20 bool fields) in crates/nh-core/src/args.rs:50
  • CleanArgs (5 bool fields) in crates/nh-clean/src/args.rs:24
  • OsRebuildArgs (4 bool fields) in crates/nh-nixos/src/args.rs:143
  • OsRollbackArgs (4 bool fields) in crates/nh-nixos/src/args.rs:216

Use targeted #[allow(clippy::struct_excessive_bools)] on these structs instead to preserve lint signal elsewhere.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` at line 85, The workspace-wide clippy allow
`struct_excessive_bools` should be removed from Cargo.toml and replaced with
targeted annotations: add `#[allow(clippy::struct_excessive_bools)]` directly
above the struct definitions for NixBuildPassthroughArgs, CleanArgs,
OsRebuildArgs, and OsRollbackArgs so the lint is only suppressed for those four
structs while restoring the lint elsewhere.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Cargo.toml`:
- Line 28: Update the clap_mangen dependency declaration to enable the env
feature so environment-backed arguments are supported: change the clap_mangen
entry in Cargo.toml to include features = ["env"] (keeping version "0.3.0");
this ensures the Main command usage of env = "NH_ELEVATION_STRATEGY" in the
interface.rs code and the man page generation in xtask/src/man.rs will correctly
handle environment variables when producing the man pages.

---

Nitpick comments:
In `@Cargo.toml`:
- Line 85: The workspace-wide clippy allow `struct_excessive_bools` should be
removed from Cargo.toml and replaced with targeted annotations: add
`#[allow(clippy::struct_excessive_bools)]` directly above the struct definitions
for NixBuildPassthroughArgs, CleanArgs, OsRebuildArgs, and OsRollbackArgs so the
lint is only suppressed for those four structs while restoring the lint
elsewhere.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7acb2157-0d33-4359-bef7-c9bab5931d0a

📥 Commits

Reviewing files that changed from the base of the PR and between 291480a and afcac1f.

📒 Files selected for processing (8)
  • Cargo.toml
  • crates/nh-core/src/checks.rs
  • crates/nh-core/src/command.rs
  • crates/nh-core/src/installable.rs
  • crates/nh-core/src/util.rs
  • crates/nh-home/src/home.rs
  • crates/nh-nixos/src/args.rs
  • crates/nh-nixos/src/generations.rs
💤 Files with no reviewable changes (1)
  • crates/nh-nixos/src/args.rs
✅ Files skipped from review due to trivial changes (4)
  • crates/nh-core/src/util.rs
  • crates/nh-home/src/home.rs
  • crates/nh-core/src/command.rs
  • crates/nh-nixos/src/generations.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/nh-core/src/checks.rs

Comment thread Cargo.toml Outdated
@NotAShelf
Copy link
Copy Markdown
Member

Merging once CI passes

@NotAShelf NotAShelf merged commit bb23118 into master Apr 18, 2026
12 of 14 checks passed
@NotAShelf NotAShelf deleted the faukah/push-yryuqwzttuzy branch April 18, 2026 10:43
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