Repository navigation
fix(clippy): clear workspace-gate lint errors in jcode-telemetry-core and jcode-setup-hints - #169
KooshaPari wants to merge 3 commits into
Conversation
The clippy gate ran without --workspace, so cargo only built the root package's dependency graph. crates/jcode-sdk is a workspace member with no dependents and was never linted: the green run 39390720989 shows the clippy step checking 93 crates against a 94-package workspace, with jcode-sdk the only member absent. That gap was not theoretical. cargo test -p jcode-sdk parity in the same run emitted a dead_code warning for the unused type alias Subscriber at crates/jcode-sdk/src/client.rs:330. Removing the dead alias and adding --workspace closes both the violation and the blind spot. tx-agent: jcode tx-validated: cargo-check tx-scope: .github/workflows/ci.yml, crates/jcode-sdk/src/client.rs tx-intent: Close the CI clippy workspace-coverage gap and remove the dead code it hid
…asses Workspace-wide clippy newly covers jcode-telemetry-core and jcode-setup-hints, exposing pre-existing lints in their test targets that the old root-package-only clippy command never checked. - jcode-telemetry-core: the live HTTP delivery path is already inert under cfg(test) (payloads are captured into TEST_EMITTED_PAYLOADS), so gate the delivery re-export, its exclusive imports, constants/statics, and the eight delivery functions with #[cfg(not(test))]. - jcode-setup-hints: split the shared macos_terminal import. MacTerminalKind stays #[cfg(any(test, target_os = "macos"))] because the notice helper and its tests use it; effective_macos_terminal becomes #[cfg(target_os = "macos")] because every caller sits behind that gate. Non-test builds are byte-identical; no test was removed or weakened. Closes #165 tx-agent: jcode tx-validated: cargo-check tx-scope: crates/jcode-telemetry-core, crates/jcode-setup-hints
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
CodeAnt PR Risk: Low Risk
Assessed commit: |
…rkspace-lint-fixes Carries PR #166's --workspace clippy gate into PR #169 so this branch's own CI validates the lint fixes it ships. The gate newly compiles jcode-telemetry-core and jcode-setup-hints (never built by the root package's dependency graph) plus jcode-sdk, which is why the jcode-sdk dead-code hunk from #166 is required here too. Conflict-free: the two branches touch disjoint files (#169: telemetry-core + setup-hints; #166: ci.yml + jcode-sdk/src/client.rs). No test removed or weakened. tx-agent: jcode tx-validated: pending-local-clippy tx-task: #170 tx-scope: ci.yml, jcode-sdk, jcode-telemetry-core, jcode-setup-hints tx-intent: make the workspace clippy gate self-validating on this branch
|
Sibling PR #190 (branch |
Summary
Fixes the 19 pre-existing clippy errors that the workspace-wide
-D warningsgate newly exposes. Closes #170.Why this PR is self-validating
This branch originally sat on
origin/master, whose CI ran the old clippy command:Without
--workspace, cargo builds only the root packagekcodeand its dependency graph.jcode-telemetry-coreandjcode-setup-hintsare not in that graph, so a CI run on this branch could not possibly have exercised the crates it fixes.This branch therefore now also carries #166's
--workspaceclippy gate change, merged in as a normal merge commit (ce0763b8, parents41d15bac+762da9fb, conflict-free — the two branches touch disjoint files). Its own CI now runs:so the fix is validated by the very gate that motivates it.
Because
--workspacealso newly compilesjcode-sdk, #166's companion hunk incrates/jcode-sdk/src/client.rs(removal of the unusedtype Subscriber = (u64, Option<String>, Sender<ApiEvent>);alias) is included here as well. Without it this branch's own CI would fail injcode-sdk.The merged files are disjoint, so this is a clean combination of both PRs. When #166 lands separately, GitHub will recognise this branch as already containing those commits.
Fixed sites
crates/jcode-telemetry-core/src/lib.rs#[cfg(not(test))]on items only the live HTTP delivery path reads (unused in the--all-targetstest build): thepub(crate) use delivery::{background_sender, post_payload, transcript_background_sender};re-export;std::sync::OnceLock;std::sync::atomic::{AtomicBool, Ordering};std::sync::mpsc::{SyncSender, TrySendError}; constsASYNC_SEND_TIMEOUT/BACKGROUND_QUEUE_CAPACITY; staticsTELEMETRY_PERMANENTLY_REJECTED,TELEMETRY_BACKGROUND_SENDER,TRANSCRIPT_BACKGROUND_SENDER,TELEMETRY_HTTP_CLIENT.crates/jcode-telemetry-core/src/delivery.rs#[cfg(not(test))]on the live delivery surface the test module never reaches: thejcode_logging,OnceLock,atomic::Ordering,Duration, andsuper::{...}imports, plushttp_client,post_payload,post_payload_with_retry,post_transcript_payload,init_background_sender,sender,background_sender,transcript_background_sender.crates/jcode-setup-hints/src/lib.rsSplit the shared
#[cfg(any(test, target_os = "macos"))] use macos_terminal::{MacTerminalKind, effective_macos_terminal};into per-name gates —MacTerminalKindkeepsany(test, target_os = "macos"),effective_macos_terminalis narrowed totarget_os = "macos"(every caller already is). The combined import was unused in a non-macOS--all-targetstest build.Explicit assurance: no test removed or weakened
No test, no assertion, and no production behavior was removed, deleted, skipped, or weakened.
#[cfg(not(test))]gates compile items out of test builds only; the production delivery path is byte-identical and still compiled and checked.#[cfg(test)] mod testsbodies are untouched.return true;becoming the equivalent tail expressiontruein the#[cfg(test)]arm ofsend_transcript_payload— is behaviour-preserving: in a test build that block is the entire function body, so both forms return the identical value.The fix uses
#[cfg]gating of test-only / platform-only items, matching the pattern already used throughout this repo.Validation
Scoped clippy over exactly the three affected crates:
The full
cargo clippy --workspace --all-targets --all-features -- -D warningsgate runs on this branch's own CI.