refactor(core): reduce clippy::too_many_lines suppressions (50 → 11)#1779
Merged
refactor(core): reduce clippy::too_many_lines suppressions (50 → 11)#1779
Conversation
…ide (#1734) Extract helper functions from over-long functions across zeph-acp, zeph-tui, and zeph-core to bring all functions under the 100-line clippy threshold. Zero #[allow(clippy::too_many_lines)] suppressions remain. Zero behavior change.
Resolve conflicts in zeph-acp/agent/{helpers,mod}.rs,
zeph-core/agent/mod.rs, and zeph-core/bootstrap/provider.rs.
Keep both upstream changes and refactoring extractions.
REVIEW-01: restore prune_tool_outputs_preserves_overflow_reference in context/mod.rs and scheduler_loop_channel_close_returns_failed in tests.rs; also restore the prune_tool_outputs overflow-reference logic in summarization.rs (extract_overflow_ref helper + three call sites) and fix run_scheduler_loop to return GraphStatus::Failed on channel close instead of Canceled (#1614). REVIEW-02: restore two CHANGELOG entries for #1614 (COV-04 test) and #1740 (overflow-reference preservation on pruning). REVIEW-S01: add justification comments to three remaining suppressions in cascade_chat, Config::default, and new_with_registry_arc.
8 tasks
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.
Closes #1734
Summary
#[allow(clippy::too_many_lines)]suppressionsrun_scheduler_loopgrowth in merged main commits)Changes
zeph-core/agent/mod.rs: extracted
dispatch_agent_commandhandler; removed 1 suppressionzeph-core/agent/tool_execution/: extracted
check_repeat_detection, replaced module-level#![allow]with targeted#[allow]on the one remaining complex test; removed 3 suppressionszeph-core/bootstrap/provider.rs: extracted shared per-backend factory helpers; removed 5 suppressions
zeph-memory/graph/resolver.rs: extracted
embed_entity_text,handle_ambiguous_candidate; removed 2 suppressionszeph-tui/src/app.rs: extracted
handle_diff_ready,send_slash; removed 3 suppressionszeph-tui/src/command.rs: split
build_extra_commandsinto 3 sub-functions; removed 1 suppressionzeph-acp/src/agent/: extracted
plan_to_updates; removed 1 suppressionOther crates (zeph-llm, zeph-tools, zeph-tui/widgets): standard extract-helper pattern; removed 34 suppressions
Remaining 11 suppressions (all have justification comments)
All kept suppressions are genuinely non-decomposable:
run_scheduler_loop:tokio::select!with 4 branches — cancel token, scheduler tick, channel recv + close, shutdown signalnew_with_registry_arc: flat struct literal initializing all Agent sub-structscascade_chat/cascade_chat_stream: per-provider error/ok/budget/escalation branchesConfig::default(): flat struct literal, one field per config sectioncontext/assembly×2: async fanout + prompt assemblysubagent/manager: subagent spawn looptool_execution/native: parallel DAG tool executionexperiments/engine: experiment evaluation loopTest plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— 0 errorscargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 5560 passed