Skip to content

fix(clippy): 6 pre-existing lints (await_holding_lock, doc_lazy_continuation, clone_on_ref_ptr) break the workspace clippy gate #193

Closed

Description

@KooshaPari

Summary

The workspace clippy gate newly surfaces six lint violations that predate this change.

The previous CI gate was:

cargo clippy --all-targets --all-features -- -D warnings

Without --workspace, cargo only lints the default workspace member. The new gate is:

cargo clippy --workspace --all-targets --all-features -- -D warnings

which lints all 94 workspace members. Six violations in files that nobody changed therefore became visible.

A second pass then surfaced five more in jcode-herdr (crates/jcode-herdr/src/reporter.rs) once the first six were cleared.

All affected files are byte-identical to master — verified with git diff origin/master...<branch> -- <file> returning zero changed lines.

The six violations

1. clippy::await_holding_lock (3 errors)

The test-environment MutexGuard is deliberately held across the .await so that HOME stays stable for the whole assertion.

File Lines
crates/jcode-app-core/src/tool/apply_patch_tests.rs 255, 284
crates/jcode-app-core/src/tool/bash_tests.rs 982, 996, 1091, 1107

The sibling file crates/jcode-app-core/src/tool/applet_tests.rs already carries the file-level #![allow(clippy::await_holding_lock)] for exactly this pattern, and two more test files in the same crate use it (server/client_actions_tests.rs, server/client_disconnect_grace_tests.rs). The repo's own cleanup notes (docs/cleanup-arc-2026-10-13-OPERATOR-ACTIONS.md) record that these are resolved via the allow, with a real parking_lot::Mutex refactor explicitly out of scope for a lint cleanup.

Fix: apply the same file-level allow to the two files. No test body was changed.

2. clippy::doc_lazy_continuation (2 errors)

crates/jcode-base/src/provider/tests/model_picker_config_models.rs:13 and :14

The continuation lines of doc-list item 2 were not indented to the list body, so rustdoc did not parse them as part of the item:

//! 2. The cache namespace is process-global, so `~/.kcode/cache/minimax_models.json`
//! could hold another provider's catalog (the report found NVIDIA NIM models
//! under `source_api_base`) and silently decide the picker.

Item 1 in the same file already indents its continuations with //! .

Fix: indent the two continuation lines to match. No documentation content was removed.

3. clippy::clone_on_ref_ptr (1 error)

crates/jcode-base/src/scratch_maintenance.rs:245

let report =
    prune_stale_scratch_in(scratch, SystemTime::now(), 7 * DAY, &[busy_dir.clone()]);

prune_stale_scratch_in takes busy: &[PathBuf], so &[busy_dir.clone()] builds a temporary slice from a reference.

Fix: use std::slice::from_ref(&busy_dir). Same value, no behaviour change.

4. clippy::await_holding_lock (5 errors, jcode-herdr)

crates/jcode-herdr/src/reporter.rs lines 482, 502, 526, 552, 570.

The HERDR test-env guard is documented as "Every test that touches HERDR_* keys must hold this guard for its entire body", and the reporter's state transitions must observe the mocked HERDR_ENV for the whole test, so the guard is intentionally held across the await.

Fix: file-level #![allow(clippy::await_holding_lock)], matching the repo's existing convention.

Constraints honoured

  • No test assertion was removed, weakened, or skipped.
  • No #[cfg(...)] was added to exclude code from the build.
  • No CI workflow or clippy configuration was changed.
  • The swallowed-error budget (scripts/swallowed_error_budget.json) is unaffected: the diff adds no new let _, .ok(), or unwrap_or_default() usage.

Evidence

CI job 121049864506 (PR #190, run 40153522888) failed at step "Run clippy with warnings denied" with exactly these six errors and no others.
CI job 121349293706 (PR #194, run 40242916639) then failed with the five jcode-herdr errors listed above.

Total: 11 pre-existing lints across 4 files in 3 crates.

Activity

  1. coderabbitai commented on Oct 25, 2026

    @coderabbitai
    🔗 Related PRs

    #190 - fix(ci): give the desk-linux build cold-cache timeout budgets (PR #169 sibling) [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    kilo-triaged
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kilo-triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions