Skip to content

fix(lints): clear the seven clippy errors CI reports - #42

Merged
PermutationResearch merged 1 commit into
fix/hearth-cifrom
fix/hearth-clippy
Dec 1, 2026
Merged

PermutationResearch merged 1 commit into
fix/hearth-cifrom
fix/hearth-clippy

Conversation

@PermutationResearch

Copy link
Copy Markdown
Owner

What

The workflow added in #40 turned red on clippy, before the test step ever ran. These are pre-existing violations under the repository's own clippy.toml policy:

Site Fix
chatgpt_plan_store.rs:76,206,275,500 — tokio_postgres::Transaction::query_one (advisory locks) use crate::db::GenericClient, so the calls dispatch to the trait method that prepares once and keeps the statement
threads/comparison.rs:371 — collapsible if folded into a let-chain
chatgpt_plan.rs:17 — items after a test module mod tests moved below Plans/impl Plans
hearth-cli/tests/common/mod.rs:65,135,157 — dead code in a shared fixture module one #![allow(dead_code)] for the module, and the two now-duplicate outer #[allow(dead_code)] on mod common; removed (that is how hearth-control/tests/common already does it)

No behaviour change: the advisory locks are the same statements, the comparison branch has the same control flow and the same early return, and only module/test ordering moved.

Verification

  • cargo fmt --all --check — clean.
  • cargo clippy -p hearth-control -p hearth-cli --all-targets -- -D warnings — exit 0, no errors (local toolchain 1.99; CI runs 1.100, so CI is the deciding check).
  • The repo's pre-commit gate (pre-commit via .git/hooks) passed on the staged files, rustfmt included.

CI on this PR should now reach cargo test --workspace, which has never run on this repository. Any failure there is new information, not a regression from this diff.

`cargo clippy --workspace --all-targets -- -D warnings` failed before the
test step ran, on code that predates the workflow.

- chatgpt_plan_store.rs: import db::GenericClient, so the four advisory-lock
  `query_one` calls dispatch to the trait method that prepares once and keeps
  the statement. clippy.toml disallows tokio-postgres' inherent method.
- threads/comparison.rs: fold the nested `if` into a let-chain.
- chatgpt_plan.rs: move `mod tests` below the items it tests.
- hearth-cli/tests/common/mod.rs: one `#![allow(dead_code)]` for fixtures the
  binaries share but do not all use, and drop the two now-duplicate outer
  allows. That is how hearth-control/tests/common already does it.
@PermutationResearch
PermutationResearch merged commit f7f0ba7 into fix/hearth-ci Dec 1, 2026
4 of 6 checks passed
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