Remove clippy too_many_lines lint and decompose long functions#7064
Merged
codefromthecrypt merged 2 commits intomainfrom Feb 7, 2026
Merged
Remove clippy too_many_lines lint and decompose long functions#7064codefromthecrypt merged 2 commits intomainfrom
codefromthecrypt merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the custom clippy baseline tooling (previously used to gate clippy::too_many_lines) in favor of standard cargo clippy, and refactors goose-cli’s session builder to reduce function length/complexity.
Changes:
- Remove
scripts/clippy-lint.sh/scripts/clippy-baseline.shand thetoo_many_linesbaseline file. - Update CI/Just/docs to run
cargo clippy --all-targets -- -D warningsand run the banned TLS crate check explicitly. - Decompose
crates/goose-cli/src/session/builder.rs::build_sessioninto smaller helper functions and addclippy.toml.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/clippy-lint.sh | Removed combined clippy + baseline runner script. |
| scripts/clippy-baseline.sh | Removed baseline-only “fail on new violations” infrastructure. |
| crates/goose-cli/src/session/builder.rs | Refactors build_session into helpers and adjusts extension-loading flow. |
| clippy.toml | Adds clippy configuration (too-many-lines threshold). |
| clippy-baselines/too_many_lines.txt | Removes stored baseline violations list. |
| Justfile | Replaces script invocation with direct cargo clippy + TLS-crate check. |
| HOWTOAI.md | Updates contributor guidance to use direct cargo clippy. |
| CONTRIBUTING.md | Updates “run the linter” instructions to direct cargo clippy. |
| AGENTS.md | Updates workflow/lint instructions to reflect removal of the script. |
| .github/workflows/goose-issue-solver.yml | Updates checklist to use direct cargo clippy. |
| .github/workflows/ci.yml | Updates CI to run direct cargo clippy and adds separate TLS-crate check step. |
| .github/copilot-instructions.md | Updates CI/lint references from the removed script to cargo clippy. |
Remove the custom clippy-lint.sh script, clippy-baseline.sh, and the clippy-baselines/ directory. Replace all references with standard cargo clippy --all-targets -- -D warnings. Add clippy.toml with too-many-lines-threshold = 200 to raise the default threshold from 100. The check-no-native-tls.sh script is preserved as a separate step in CI and the Justfile. Updates across: CI workflows, Justfile, AGENTS.md, CONTRIBUTING.md, HOWTOAI.md, and copilot-instructions.md.
Extract 5 helper functions from the 255-line build_session function to bring it under the 200-line clippy threshold (now 127 lines): - resolve_provider_and_model: provider/model resolution with fallback chain - resolve_session_id: session ID determination (no_session/resume/new) - handle_resumed_session_workdir: working directory reconciliation - resolve_and_load_extensions: extension gathering and loading - configure_session_prompts: system prompt setup and extension persistence
408982f to
2efbb84
Compare
kuccello
pushed a commit
to kuccello/goose
that referenced
this pull request
Feb 7, 2026
tlongwell-block
added a commit
that referenced
this pull request
Feb 9, 2026
* origin/main: (55 commits) test(mcp): add image tool test and consolidate MCP test fixtures (#7019) fix: remove Option from model listing return types, propagate errors (#7074) fix: lazy provider creation for goose acp (#7026) (#7066) Smoke tests: split compaction test and use debug build (#6984) fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061) feat: expose AGENT_SESSION_ID env var to extension child processes (#7072) fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882) Remove clippy too_many_lines lint and decompose long functions (#7064) refactor: move disable_session_naming into AgentConfig (#7062) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) ... # Conflicts: # scripts/test_subrecipes.sh
lifeizhou-ap
added a commit
that referenced
this pull request
Feb 9, 2026
* main: (101 commits) fix: lazy provider creation for goose acp (#7026) (#7066) Smoke tests: split compaction test and use debug build (#6984) fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061) feat: expose AGENT_SESSION_ID env var to extension child processes (#7072) fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882) Remove clippy too_many_lines lint and decompose long functions (#7064) refactor: move disable_session_naming into AgentConfig (#7062) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051) Remove build-dependencies section from Cargo.toml (#6946) add /rp-why skill blog post (#6997) fix: fix snake_case function names in code_execution instructions (#7035) Document max_turns settings for recipes and subagents (#7044) feat: update Groq declarative data with Preview Models (#7023) ...
jh-block
added a commit
that referenced
this pull request
Feb 9, 2026
* origin/main: (54 commits) chore: strip posthog for sessions/models/daily only (#7079) tidy: clean up old benchmark and add gym (#7081) fix: use command.process_group(0) for CLI providers, not just MCP (#7083) added build notify (#6891) test(mcp): add image tool test and consolidate MCP test fixtures (#7019) fix: remove Option from model listing return types, propagate errors (#7074) fix: lazy provider creation for goose acp (#7026) (#7066) Smoke tests: split compaction test and use debug build (#6984) fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061) feat: expose AGENT_SESSION_ID env var to extension child processes (#7072) fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882) Remove clippy too_many_lines lint and decompose long functions (#7064) refactor: move disable_session_naming into AgentConfig (#7062) Add global config switch to disable automatic session naming (#7052) docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059) fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047) Show recommended model on failture (#7040) feat(ui): add session content search via API (#7050) docs: fix img url (#7053) Desktop UI for deleting custom providers (#7042) ...
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
Tyler-Hardin
pushed a commit
to Tyler-Hardin/goose
that referenced
this pull request
Feb 11, 2026
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.
Summary
Remove the custom
clippy-lint.sh/clippy-baseline.shinfrastructure for thetoo_many_linesclippy lint, and replace it with standardcargo clippy. Then decompose the longest offending function (build_session) into focused helpers.Why
too_many_lineslint produced very long output that made it hard for LLMs (which work on this codebase) to check their work — the signal-to-noise ratio was poor.cargo clippydirectly, which is simpler and well-understood.The second commit refactors
build_session(the longest function flagged by the old lint) into smaller, focused helper functions as a concrete improvement.Closes #6271