Skip to content

Apply automatic clippy fixes in CLI#5427

Merged
proggeramlug merged 5 commits into
mainfrom
feat/clippy-cli-auto-fixes
Jun 19, 2026
Merged

Apply automatic clippy fixes in CLI#5427
proggeramlug merged 5 commits into
mainfrom
feat/clippy-cli-auto-fixes

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Applies mechanical cargo clippy --fix suggestions in the Perry CLI crate.
  • Keeps changes scoped to compile, setup, run, publish, install, and helper command modules.

Validation

  • cargo fmt --all -- --check
  • cargo check -p perry

Remaining warning output is pre-existing warning debt not covered by automatic fixes in this branch.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Streamlined build/compile orchestration, module wiring, and internal helper imports.
    • Cleaned up linking flag handling and iOS app bundle assembly details.
    • Simplified internal checks and consistency improvements across build steps.
  • Bug Fixes
    • Preserved diagnostic collection behavior during compilation and refined audit manifest error handling.
    • Minor correctness tweaks to symbol/scope and generated length calculations.
  • Documentation
    • Adjusted a tarball-generation comment formatting.

Note: Changes are internal maintenance with no expected end-user impact.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c8925917-e544-4cde-a8ea-8d97cc6d9b12

📥 Commits

Reviewing files that changed from the base of the PR and between 4a91221 and 5717e4a.

📒 Files selected for processing (1)
  • crates/perry/src/commands/publish/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/perry/src/commands/publish/mod.rs

📝 Walkthrough

Walkthrough

Widespread idiomatic Rust cleanup across crates/perry/src/commands: removes unused imports, simplifies iterator/containment patterns, adopts or_default() and slice::contains, derives Default on LockMode, narrows pub use re-exports in run/mod.rs, setup/mod.rs, and publish/mod.rs, and applies minor borrow/ownership fixes at call sites.

Changes

Idiomatic Rust cleanup and re-export narrowing

Layer / File(s) Summary
Compile orchestration: unused imports, iterator/type simplification
crates/perry/src/commands/compile.rs, crates/perry/src/commands/compile/types.rs
Removes unused clap::Args and perry_hir imports; simplifies ctx.native_modules loops to .values(); switches BTreeMap init to or_default(); removes as u32 cast on class.id; fixes namespace_imports.contains reference shape; converts NativeObjectArtifact return to expression style.
Compile submodule idiom fixes
crates/perry/src/commands/compile/audit_manifest.rs, crates/perry/src/commands/compile/targets.rs, crates/perry/src/commands/compile/resolve.rs, crates/perry/src/commands/compile/strip_dedup.rs, crates/perry/src/commands/compile/cjs_wrap/mod.rs, crates/perry/src/commands/compile/collect_modules.rs, crates/perry/src/commands/compile/collect_modules/dynamic_glob.rs
Uses std::io::Error::other(); replaces as_bytes().len() with len(); moves dedup into match guard in resolve_exports_candidates; uses slice::contains in strip_dedup and extract_requires; removes pub(self) from cjs_wrap imports; simplifies parse_cache match and converts tail return in collect_modules; removes use super::* in dynamic_glob.
Linker: tier-3 args, pkg-config split, Windows .lib detection, re-export removal
crates/perry/src/commands/compile/link/build_and_run.rs, crates/perry/src/commands/compile/link/mod.rs
Passes dedup stdlib/runtime results directly (no borrow) to cmd.arg; replaces libs.trim().split_whitespace() with libs.split_whitespace() across all pkg-config fallback paths; simplifies Windows .lib check to is_some_and; removes WINDOWS_APP_MANIFEST pub(super) re-export.
iOS bundle assembly: borrow/ownership and pattern simplifications
crates/perry/src/commands/compile/bundle_ios.rs
Removes extra & borrows on exe_path, input, and ctx at call sites; switches i18n if let destructuring from ref patterns to owned; refactors image_views XML from format! to raw string + to_string().
Run/publish/check/i18n/install/native: re-export narrowing and small fixes
crates/perry/src/commands/run/mod.rs, crates/perry/src/commands/run/remote.rs, crates/perry/src/commands/run/resign.rs, crates/perry/src/commands/publish/mod.rs, crates/perry/src/commands/publish/tarball.rs, crates/perry/src/commands/check.rs, crates/perry/src/commands/i18n.rs, crates/perry/src/commands/install/allowlist.rs, crates/perry/src/commands/native/init.rs, crates/perry/src/commands/perry_lock.rs
Narrows pub use exports in run/mod.rs; swaps BetaConfig/IosSavedConfig for AndroidSavedConfig/HarmonyosSavedConfig in publish re-exports; passes Android serial by value in remote.rs; uses next_back() for bundle_id last segment; drops .into_iter() in check.rs; inlines removed_count init; uses slice::contains in allowlist; combines existence+force guard in native/init; derives Default on LockMode.
Setup modules: unused import removal and re-export narrowing
crates/perry/src/commands/setup/mod.rs, crates/perry/src/commands/setup/android.rs, crates/perry/src/commands/setup/common_apple.rs, crates/perry/src/commands/setup/harmonyos.rs, crates/perry/src/commands/setup/helpers.rs, crates/perry/src/commands/setup/ios.rs, crates/perry/src/commands/setup/macos.rs, crates/perry/src/commands/setup/tvos.rs, crates/perry/src/commands/setup/visionos.rs, crates/perry/src/commands/setup/watchos.rs, crates/perry/src/commands/setup/windows.rs
Removes clap::Args, unused dialoguer prompts, std path/process, and extra publish-config type imports from each platform setup module; narrows setup/mod.rs re-exports by dropping prompt_password from harmonyos and removing the macOS certificate utility exports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PerryTS/perry#5236: Modifies crates/perry/src/commands/compile.rs in the same compile orchestration area with shared deferred-eval/dynamic-import framework changes.
  • PerryTS/perry#5406: Both PRs modify linker orchestration in crates/perry/src/commands/compile/link/, including WINDOWS_APP_MANIFEST re-export visibility and linking logic in build_and_run.rs.

Poem

🐇 Hop, hop through the fields of Rust so fine,
Removing extra &s like old tangled vine,
or_default() blooms where verbose code grew,
slice::contains hops where iterators flew,
The warren is tidy, the imports are lean —
A cleaner codebase than you've ever seen! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: applying automatic clippy fixes to the CLI crate, which is confirmed by all file changes.
Description check ✅ Passed The description provides a clear summary, concrete changes list, and test plan validation steps. All major template sections are present and completed with appropriate detail.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/clippy-cli-auto-fixes

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

TheHypnoo and others added 4 commits June 19, 2026 00:27
clippy --fix dropped two re-exports whose only consumers live in
#[cfg(test)] modules, breaking `cargo test -p perry`:

- `compile::link::WINDOWS_APP_MANIFEST` (used by windows_link_tests)
- `publish::IosSavedConfig` (used by publish::tests)

Both are restored gated with #[cfg(test)] so the non-test build stays
clean (no reintroduced clippy unused-import error) while the test build
resolves the symbols again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@proggeramlug proggeramlug merged commit 1db8e6b into main Jun 19, 2026
15 checks passed
@proggeramlug proggeramlug deleted the feat/clippy-cli-auto-fixes branch June 19, 2026 09:34
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