Skip to content

style: enforce clippy::new_without_default - #266

Draft
danieleades wants to merge 6 commits into
httpmock:masterfrom
danieleades:agent/clippy-new-without-default
Draft

style: enforce clippy::new_without_default#266
danieleades wants to merge 6 commits into
httpmock:masterfrom
danieleades:agent/clippy-new-without-default

Conversation

@danieleades

Copy link
Copy Markdown
Contributor

Removes new_without_default from the Clippy allow-list and adds Default implementations for the server builder and public comparator types while preserving their public new() constructors. The private HTTPS builder now uses its derived default directly.

Depends on #238.

Checks: cargo +stable fmt --all -- --check; cargo +stable clippy --all-targets --all-features.

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Add a [lints.clippy] table that denies clippy::all so new lint violations
fail CI. The lints that already fired when clippy was re-enabled are
allow-listed as tracked backlog, to be removed one class per stacked PR.

This PR also clears the first class: rewrite the 46 bool_assert_comparison
violations (assert_eq!(expr, true/false) -> assert!(expr) / assert!(!(expr)))
across the comparison matcher tests and one util test, so that lint is
enforced rather than allowed.
The test, coverage, and feature-combination jobs inherit the default
`-D warnings` from setup-rust-toolchain, so rustc warnings that surfaced
when `#![allow(warnings)]` was removed failed CI as hard errors.

Add a [lints.rust] table mirroring [lints.clippy]: gate the `warnings`
group at deny so regressions fail CI, and allow-list the existing
backlog (dead_code, unused_*, private_bounds, mismatched_lifetime_syntaxes)
to be burned down one class per stacked PR. Denying via the manifest keeps
local dev and CI consistent.
mismatched_lifetime_syntaxes does not exist on the 1.88.0 MSRV toolchain,
and the newly-denied `warnings` group escalates the resulting unknown_lints
warning to an error. Allow unknown_lints so lint names that only exist on
newer toolchains are silently ignored on older ones.
@danieleades
danieleades force-pushed the agent/clippy-new-without-default branch from aa99634 to 9a4a7e0 Compare August 9, 2026 14:11
@danieleades
danieleades force-pushed the agent/clippy-new-without-default branch from 9a4a7e0 to 1114dab Compare August 9, 2026 14:23
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.

1 participant