Skip to content

chore(code-quality): Set max 200 line limit for long methods - #595

Merged
ndizazzo merged 2 commits into
mainfrom
chore/code-size
May 19, 2026
Merged

chore(code-quality): Set max 200 line limit for long methods#595
ndizazzo merged 2 commits into
mainfrom
chore/code-size

Conversation

@ndizazzo

Copy link
Copy Markdown
Collaborator

Adds a 200 line limit to Rust methods, so we don't have giant unreadable code blocks

@ndizazzo ndizazzo self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a Clippy-enforced maximum line-count for Rust functions/methods (200 lines) and refactors several long runtime/network/UI/test routines into smaller helpers to satisfy the new constraint and keep core runtime logic more readable.

Changes:

  • Enable clippy::too_many_lines (warn) at the workspace level and configure too-many-lines-threshold = 200.
  • Refactor long functions across runtime startup/auto mode, OpenAI ingress proxy routing, runtime-data view building, and dashboard event handling into smaller helper functions/structs.
  • Restructure API payload-stability tests into reusable seed/request/assert helpers.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/mesh-llm-host-runtime/src/runtime/mod.rs Extracts startup publishing + event loop pieces and introduces grouped run-auto state/context structs to reduce long function bodies.
crates/mesh-llm-host-runtime/src/runtime/local.rs Extracts downstream stage-loading loop and stage-load request construction for split runtime generation.
crates/mesh-llm-host-runtime/src/runtime_data/collector.rs Breaks up build_model_view payload construction into helper functions and a build context.
crates/mesh-llm-host-runtime/src/network/router.rs Refactors classification heuristics into smaller helpers and structures signal scoring.
crates/mesh-llm-host-runtime/src/network/openai/ingress.rs Splits the API proxy request handling into discrete helpers (binding, control endpoints, auto-route decision, routing).
crates/mesh-llm-host-runtime/src/cli/output/mod.rs Refactors dashboard event application into focused helper methods; expands and de-duplicates test helpers.
crates/mesh-llm-host-runtime/src/api/tests.rs Extracts state seeding + request helpers and assertion helpers for management API payload stability tests.
clippy.toml Configures Clippy too-many-lines-threshold = 200.
Cargo.toml Enables workspace Clippy lint too_many_lines = "warn".
AGENTS.md Documents new “code quality rules” (line count, file size, cognitive complexity) for new code.

Comment thread crates/mesh-llm-host-runtime/src/network/openai/ingress.rs Outdated
Comment thread crates/mesh-llm-host-runtime/src/network/openai/ingress.rs Outdated
@ndizazzo
ndizazzo merged commit 5e556cf into main May 19, 2026
21 checks passed
@ndizazzo
ndizazzo deleted the chore/code-size branch May 19, 2026 22:22
michaelneale added a commit that referenced this pull request May 19, 2026
* origin/main:
  fix(runtime): proxy through mesh during serve --auto startup (#591)
  chore(code-quality): Set max 200 line limit for long methods (#595)
michaelneale added a commit that referenced this pull request May 20, 2026
* origin/main:
  fix(mesh): skip filtered peers in gossip dial loop to unwedge `--auto` (#602)
  docs(agents): clarify just build vs release-build for serious testing (#599)
  build: ozempic — slim binary -42 MB / -47 MB (#592)
  fix(runtime): proxy through mesh during serve --auto startup (#591)
  chore(code-quality): Set max 200 line limit for long methods (#595)
  fly size bump (#590)
  agents is now up to date (#588)
  fix(ci): fix CI PR cleanup job to delete in batches (#587)
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