chore(lint): clear clippy -D warnings across fj binary (FJ-13) #7

Merged
David merged 1 commit from chore/clippy-clean-fj-13 into main 2026-05-25 15:37:43 +02:00
Owner

Clears all 108 clippy -D warnings errors that just check-clippy reported on the crates/fj binary under Rust 1.94, restoring the CI lint gate and the pre-commit hook. Resolves FJ-13.

No runtime behavior or CLI surface change: every subcommand, flag, and ValueEnum value (including fj completion power-shell) is identical to before.

What changed

Mechanical lints fixed at every flagged site, mostly via cargo clippy --fix: needless_borrow, explicit_auto_deref, unnecessary_lazy_evaluations, wildcard_in_or_patterns, needless_borrows_for_generic_args, needless_question_mark, needless_return, println_empty_string, double_ended_iterator_last, option_as_ref_deref, extra_unused_lifetimes, cmp_owned, manual_repeat_n, from_over_into.

if_same_then_else at repo.rs: the two arms both produced (remote_url, remote_repo_name), so they are merged into one ||-combined condition. Behavior-preserving.

8 too_many_arguments functions refactored to <= 7 params via per-function argument structs (CreateIssueArgs, EditOrgLabelArgs, CreatePrArgs, CreateReleaseArgs, EditReleaseArgs, CreateRepoArgs, MigrateRepoArgs, EditRepoLabelArgs). Field names match the former parameter names; each single call site updated. No #[allow(clippy::too_many_arguments)] added.

type_complexity on auth_server cleared with a named AuthServer type alias. No #[allow].

Documented #[allow] only where a real fix is out of scope: clippy::enum_variant_names on the Shell enum (renaming PowerShell would change the completion value and break the CLI), and clippy::crate_in_macro_def on ftl_prompt! / ftl_prompt_bool! with a TODO(FJ-7) deferring the $crate:: fix to the crate split. The crate:: references are left untouched.

Verification

cargo clippy --all-targets -- -D warnings, cargo fmt --check, cargo build --all-targets, and cargo test all pass. fj completion power-shell still emits the PowerShell completion script unchanged.

🤖 Generated with Claude Code

Clears all 108 `clippy -D warnings` errors that `just check-clippy` reported on the `crates/fj` binary under Rust 1.94, restoring the CI lint gate and the pre-commit hook. Resolves FJ-13. No runtime behavior or CLI surface change: every subcommand, flag, and `ValueEnum` value (including `fj completion power-shell`) is identical to before. ## What changed Mechanical lints fixed at every flagged site, mostly via `cargo clippy --fix`: `needless_borrow`, `explicit_auto_deref`, `unnecessary_lazy_evaluations`, `wildcard_in_or_patterns`, `needless_borrows_for_generic_args`, `needless_question_mark`, `needless_return`, `println_empty_string`, `double_ended_iterator_last`, `option_as_ref_deref`, `extra_unused_lifetimes`, `cmp_owned`, `manual_repeat_n`, `from_over_into`. `if_same_then_else` at `repo.rs`: the two arms both produced `(remote_url, remote_repo_name)`, so they are merged into one `||`-combined condition. Behavior-preserving. 8 `too_many_arguments` functions refactored to <= 7 params via per-function argument structs (`CreateIssueArgs`, `EditOrgLabelArgs`, `CreatePrArgs`, `CreateReleaseArgs`, `EditReleaseArgs`, `CreateRepoArgs`, `MigrateRepoArgs`, `EditRepoLabelArgs`). Field names match the former parameter names; each single call site updated. No `#[allow(clippy::too_many_arguments)]` added. `type_complexity` on `auth_server` cleared with a named `AuthServer` type alias. No `#[allow]`. Documented `#[allow]` only where a real fix is out of scope: `clippy::enum_variant_names` on the `Shell` enum (renaming `PowerShell` would change the completion value and break the CLI), and `clippy::crate_in_macro_def` on `ftl_prompt!` / `ftl_prompt_bool!` with a `TODO(FJ-7)` deferring the `$crate::` fix to the crate split. The `crate::` references are left untouched. ## Verification `cargo clippy --all-targets -- -D warnings`, `cargo fmt --check`, `cargo build --all-targets`, and `cargo test` all pass. `fj completion power-shell` still emits the PowerShell completion script unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(lint): clear clippy -D warnings across fj binary (FJ-13)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 36s
Create release / Create release from merged PR (pull_request) Has been skipped
efb1ab784a
Clears all 108 clippy errors that `just check-clippy` (-D warnings) reported on the crates/fj binary under Rust 1.94, restoring the CI lint gate and pre-commit hook. No runtime behavior or CLI surface changes; every subcommand, flag, and ValueEnum value (including `completion power-shell`) is unchanged.

Mechanical lints fixed at every flagged site, mostly via `cargo clippy --fix`: needless_borrow, explicit_auto_deref, unnecessary_lazy_evaluations, wildcard_in_or_patterns, needless_borrows_for_generic_args, needless_question_mark, needless_return, println_empty_string, double_ended_iterator_last, option_as_ref_deref, extra_unused_lifetimes, cmp_owned, manual_repeat_n, and from_over_into.

Merged the two identical arms at repo.rs (if_same_then_else) into a single `||`-combined condition; both arms already produced the same (remote_url, remote_repo_name), so this is behavior-preserving.

Refactored the 8 too_many_arguments functions to <= 7 parameters via per-function argument structs (CreateIssueArgs, EditOrgLabelArgs, CreatePrArgs, CreateReleaseArgs, EditReleaseArgs, CreateRepoArgs, MigrateRepoArgs, EditRepoLabelArgs), keeping field names identical to the former parameter names and updating each call site. No `#[allow(clippy::too_many_arguments)]` added.

Replaced the complex auth_server return type with a named `AuthServer` type alias to clear type_complexity; no `#[allow]`.

Documented allows where a fix is forbidden by scope: `#[allow(clippy::enum_variant_names)]` on the `Shell` enum (renaming PowerShell would change the completion ValueEnum value), and `#[allow(clippy::crate_in_macro_def)]` on the ftl_prompt!/ftl_prompt_bool! macros with a TODO(FJ-7) deferring the real `$crate::` fix to the crate split; the `crate::` references are left untouched.

Verified: `cargo clippy --all-targets -- -D warnings`, `cargo fmt --check`, `cargo build --all-targets`, and `cargo test` all pass.

#FJ-13 State Done

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
David merged commit eeeca807ca into main 2026-05-25 15:37:43 +02:00
David deleted branch chore/clippy-clean-fj-13 2026-05-25 15:37:43 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/forgejo-cli!7
No description provided.