Skip to content

treewide: restrict unnecessary visibility, cleanup - #752

Open
faukah wants to merge 3 commits into
masterfrom
faukah/push-qzylnmornulm
Open

faukah wants to merge 3 commits into
masterfrom
faukah/push-qzylnmornulm

Conversation

@faukah

@faukah faukah commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Restrict unnecessary visibliblity across the whole project, clean up clippy lints, drop nh-config. I'll readd nh-config once we actually need it again, no need for dead code in here.

AI disclosure

Partly generated using hawk, which is total slop, but I used nothing AI-related for this.

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
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: acff180d-637b-4d5b-b9cc-956ec77ff3f5

📥 Commits

Reviewing files that changed from the base of the PR and between 4e2f836 and ea2b5b1.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • Cargo.toml
  • crates/nh-core/src/command.rs
  • crates/nh-nixos/src/generations.rs
  • crates/nh-search/src/args.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • Cargo.toml
  • crates/nh-core/src/command.rs
  • crates/nh-search/src/args.rs
  • crates/nh-nixos/src/generations.rs

📝 Walkthrough

Walkthrough

The pull request removes the nh-config workspace dependency and narrows public visibility across CLI arguments, core helpers, platform and remote utilities, generation APIs, and application entrypoints. Generation printing now returns unit.

Changes

Visibility surface reduction

Layer / File(s) Summary
Configuration dependency removal
Cargo.toml
The nh-config workspace dependency is removed.
CLI argument visibility
crates/nh-clean/src/args.rs, crates/nh-core/src/args.rs, crates/nh-darwin/src/args.rs, crates/nh-home/src/args.rs, crates/nh-nixos/src/args.rs, crates/nh-search/src/args.rs
CLI fields, helper methods, and search resolution types become crate-private or private. Parsing behavior remains unchanged.
Core helper API visibility
crates/nh-core/src/{checks.rs,command.rs,lib.rs,util.rs}
Core helpers and constants expose narrower visibility.
Platform and remote helper visibility
crates/nh-darwin/src/darwin.rs, crates/nh-nixos/src/nixos.rs, crates/nh-remote/src/remote.rs
Toplevel, remote-host, and SSH helpers become internal functions or methods.
Generation information API
crates/nh-nixos/src/generations.rs, crates/nh-nixos/src/nixos.rs
Generation metadata and inspection helpers become internal. print_info now returns ().
Application entrypoint visibility
crates/nh/src/interface.rs, crates/nh/src/lib.rs
Main command fields, dispatch methods, logging, and version constants are no longer publicly exported.

Possibly related PRs

Suggested reviewers: notashelf

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the treewide visibility restrictions and cleanup changes.
Description check ✅ Passed The description directly covers visibility restrictions, Clippy cleanup, and removal of nh-config.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@faukah
faukah force-pushed the faukah/push-qzylnmornulm branch from 863390e to 4e2f836 Compare July 27, 2026 20:53
@faukah faukah changed the title treewide: restrict unnecessary visibility treewide: restrict unnecessary visibility, cleanup Jul 27, 2026
@faukah faukah added the allow-no-changelog Doesen't need a CHANGELOG.md entry. label Jul 27, 2026
@faukah
faukah force-pushed the faukah/push-qzylnmornulm branch from 4e2f836 to ea2b5b1 Compare August 7, 2026 19:34
@NotAShelf

Copy link
Copy Markdown
Member

conflicts :/

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

Labels

allow-no-changelog Doesen't need a CHANGELOG.md entry.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants