Skip to content

style: restore rustfmt ordering in jcode-base and jcode-tui - #1818

Open
akushonkamen wants to merge 1 commit into
1jehuang:masterfrom
akushonkamen:fix/1796-cargo-fmt-master
Open

akushonkamen wants to merge 1 commit into
1jehuang:masterfrom
akushonkamen:fix/1796-cargo-fmt-master

Conversation

@akushonkamen

Copy link
Copy Markdown
Contributor

Fixes #1796

Problem

567706b (refactor(voice)) landed without running rustfmt, leaving two declaration-order violations that keep the Quality Guardrails workflow red at "Check formatting" (step 6) and mask every later step, including the ratchets:

  • crates/jcode-base/src/lib.rs: pub mod client_focus was declared after pub mod client_input
  • crates/jcode-tui/src/tui/app/voice_input.rs: the jcode_voice use group was declared before crossterm::event::KeyEvent

Change

Reorder only the two spots rustfmt requires — client_focus moves before client_input in lib.rs, jcode_voice moves after crossterm::event::KeyEvent in voice_input.rs. 2 files, ±2 lines, zero semantic changes.

Note: the step-12 code-size-budget ratchet (crates/jcode-sdk/src/client.rs currently 1985 LOC vs baseline 1968 at scripts/code_size_budget.json:70) is a shrink decision and is deliberately left out of this fix — it is declared in the commit body and in the claim comment on the issue, to be handled separately. This change does not touch the baselines.

Process notes: a timeline review of the issue (gh api repos/1jehuang/jcode/issues/1796/timeline) showed this account only had #1816 cross-referenced (#1816 touches only server.rs and desktop-open/lib.rs, zero file overlap), with no earlier claim or PR. The claim comment with AI disclosure is at #1796 (comment) (AI-assisted contributions are explicitly welcome per CONTRIBUTING.md:19). The commit follows the repo's conventional-commit style; CONTRIBUTING.md has no DCO requirement, so no sign-off was added.

Validation

  • Red→green: before the fix, cargo fmt --check -p jcode-base -p jcode-tui on pristine 54def93 (via stash round-trip) → exit 1, with the diff exactly lib.rs:28 (client_focus should move earlier) + voice_input.rs:8 (jcode_voice should move later), matching the issue verbatim. After the fix, the same command → exit 0, and workspace-wide cargo fmt --check → exit 0.
  • cargo check -p jcode-base -p jcode-tui → exit 0 (2m13s).
  • cargo test -p jcode-base -p jcode-tui: jcode-base --lib 1647 passed / 15 failed / 6 ignored — those 15 (auth::transfer/platform/session/skill/usage) also run 0 passed / 15 failed with --exact on untouched pristine master, i.e. pre-existing environment-dependent failures on this machine. jcode-tui --lib 2537 passed / 3 failed vs 2535 passed / 5 failed for the same suite on pristine master; the isolated subset (2 passed / 1 failed, all shimmer-animation timing tests) is bit-identical before and after the fix. All failures are pre-existing flaky; this change has zero test regressions.
  • All commands were run with timeouts; no unbounded builds or tests.

AI disclosure

AI-assisted change, as disclosed on the issue; per CONTRIBUTING.md, held to the same standards as handwritten code.

567706b (refactor(voice)) landed without running cargo fmt, leaving two
ordering violations that keep the Quality Guardrails workflow red at
"Check formatting" (step 6) and skip every later step:

- crates/jcode-base/src/lib.rs: pub mod client_focus was declared after
  pub mod client_input
- crates/jcode-tui/src/tui/app/voice_input.rs: the jcode_voice use group
  was declared before crossterm::event::KeyEvent

Pure rustfmt-driven reordering, no semantic changes; cargo fmt --check is
clean again for both crates and workspace-wide, and both crates still
compile.

Fixes 1jehuang#1796

Note: merging this restores formatting, but Quality Guardrails will still
be red afterwards — the code-size-budget ratchet (step 12) currently
reports 8 violations per scripts/check_code_size_budget.py on this
branch, all pre-dating this change and none touched by it:
- crates/jcode-app-core/src/server.rs (2545 -> 2556 LOC)
- crates/jcode-app-core/src/tool/browser.rs (1272 -> 1284 LOC)
- crates/jcode-sdk/src/client.rs (1968 -> 1985 LOC)
- crates/jcode-voice/src/global/hotkey.rs (new oversized, 1211 > 1200 LOC)
- src/cli/args.rs (1253 -> 1265 LOC)
- src/cli/commands.rs (3584 -> 3614 LOC)
- src/cli/dispatch.rs (1679 -> 1682 LOC)
- src/cli/login.rs (1233 -> 1256 LOC)
As the issue suggests, the baselines in scripts/code_size_budget.json are
deliberately NOT blanket --updated here; shrinking those files is a
separate decision per file.

AI-assisted change, disclosed on the issue per CONTRIBUTING.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] Safe to merge: the changes preserve the existing declarations and imported names, workspace formatting passes, and both affected crates pass locked compilation checks.

T-Rex evidence

Executed validation script

  • This script ran the bounded head checks and pristine-base formatting comparison without editing source, making the validation reproducible.

Complete validation execution

  • The captured script execution records the scoped diff, toolchain versions, command outcomes, worktree cleanup, and unchanged-source check, showing the validation completed successfully.

Workspace formatting on pristine base

  • The workspace formatting check ran against the pristine base and exited 1 with exactly the two ordering differences addressed by the PR.

Workspace formatting on PR head

  • The identical workspace formatting check ran against the PR head and exited 0, confirming the ordering changes satisfy the formatting gate.

Locked compilation check on PR head

  • The default-feature locked Cargo check ran for jcode-base and jcode-tui using the prepared cache and exited 0, confirming no scoped compilation failure.

Evidence from the check

  • This script ran the bounded head checks and pristine-base formatting comparison without editing source, making the validation reproducible.

Command output from the check

  • The captured script execution records the scoped diff, toolchain versions, command outcomes, worktree cleanup, and unchanged-source check, showing the validation completed successfully.

Command output from the check

  • The workspace formatting check ran against the pristine base and exited 1 with exactly the two ordering differences addressed by the PR.

Command output from the check

  • The identical workspace formatting check ran against the PR head and exited 0, confirming the ordering changes satisfy the formatting gate.

Command output from the check

  • The default-feature locked Cargo check ran for jcode-base and jcode-tui using the prepared cache and exited 0, confirming no scoped compilation failure.

View artifacts

Summary

Restores declaration and import ordering in two files.

  • Rust declarations now follow rustfmt’s expected order.

Reviews (1) · Last reviewed commit: "style: restore rustfmt ordering in jcode..." · Reviewed by Greptile

This branch has not been deployed

No deployments
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.

master is red: Check formatting fails on two files from 567706b70, hiding an oversized-file ratchet failure behind it

1 participant