Skip to content

policy: activate Clippy 1.94/1.95 ratchets#505

Merged
EffortlessSteven merged 1 commit into
mainfrom
policy/clippy-rust-1.95-ratchets
May 12, 2026
Merged

policy: activate Clippy 1.94/1.95 ratchets#505
EffortlessSteven merged 1 commit into
mainfrom
policy/clippy-rust-1.95-ratchets

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • Promotes 8 planned Clippy lints from [[planned]] to active in [workspace.lints.clippy], all measured clean against the workspace before activation
  • Fixes all resulting duration_suboptimal_units warnings by replacing Duration::from_secs(N*3600/86400) with from_hours/from_mins equivalents
  • Updates policy/clippy-lints.toml to move entries to [[active_clippy]] sections; keeps disallowed_fields on HOLD and defers manual_pop_if to MSRV 1.96 (not present in Rust 1.95)

Activated lints:

Lint Level Reason
same_length_and_capacity deny Catch raw-parts reconstruction mistakes
manual_ilog2 warn Prefer standard integer log helper
decimal_bitwise_operands warn Make bit masks visually inspectable
needless_type_cast warn Avoid stale numeric type drift
manual_checked_ops warn Prefer checked arithmetic
manual_take warn Use standard ownership helper
duration_suboptimal_units warn Make durations legible
unnecessary_trailing_comma warn Keep format macro calls clean

Test plan

  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings passes clean
  • cargo xtask gate --check passes (fmt + check + clippy + test-compile + public-surface + docs-sync)
  • CI pr job passes on GitHub Actions

https://claude.ai/code/session_01UtGUK2qnkGRFFVNoSqaUYB


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 44 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6e61ab50-63ae-4b40-8283-d18af60eaf15

📥 Commits

Reviewing files that changed from the base of the PR and between b13296b and a78fb4f.

📒 Files selected for processing (8)
  • Cargo.toml
  • crates/uselesskey-core-x509-spec/tests/comprehensive.rs
  • crates/uselesskey-core-x509-spec/tests/integration.rs
  • crates/uselesskey-core-x509-spec/tests/mutant_killers.rs
  • policy/clippy-lints.toml
  • tests/builder_patterns.rs
  • tests/concurrency.rs
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch policy/clippy-rust-1.95-ratchets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review checklist (PR 4 — Clippy 1.94/1.95 ratchets)

Scope correctness

  • All 8 lints were measured clean before activation (no suppression added, no baseline reset, no policy weakening)
  • disallowed_fields correctly held on HOLD (requires field-policy in clippy.toml before activation)
  • manual_pop_if correctly deferred to MSRV 1.96 (the lint does not exist in Rust 1.95; activating it would emit an "unknown lint" warning)

Code changes

  • All duration_suboptimal_units fixes use Clippy's exact suggested replacements (from_hours/from_mins); arithmetic was pre-computed for clarity (e.g. 10 * 24 = 240, 30 * 24 = 720)
  • The from_hours(720) used for both the validity_days(30) and (10+20)×24 cases in builder_patterns.rs is correct — both evaluate to 720 hours
  • No #[allow] or #[expect] suppressions introduced; all warnings resolved at source

Policy file

  • policy/clippy-lints.toml now has [[active_clippy]] entries mirroring every entry in [workspace.lints.clippy] — the policy mirror is consistent with Cargo.toml
  • manual_pop_if entry updated: activate_when_msrv = "1.96" with note explaining the deferral

Gate

  • cargo xtask gate --check passes: fmt + cargo check + clippy + test-compile + public-surface + docs-sync all green

Generated by Claude Code

Promote 8 planned Clippy lints to active in [workspace.lints.clippy]:
- same_length_and_capacity = "deny" (catch raw-parts bugs)
- manual_ilog2 / decimal_bitwise_operands / needless_type_cast = "warn"
- manual_checked_ops / manual_take / duration_suboptimal_units = "warn"
- unnecessary_trailing_comma = "warn"

Fix all resulting warnings across the workspace:
- Replace Duration::from_secs(N*3600) with from_hours/from_mins
- Move planned entries to [[active_clippy]] in policy/clippy-lints.toml
- Keep disallowed_fields on hold; defer manual_pop_if to MSRV 1.96

https://claude.ai/code/session_01UtGUK2qnkGRFFVNoSqaUYB
@EffortlessSteven EffortlessSteven force-pushed the policy/clippy-rust-1.95-ratchets branch from 40405a4 to a78fb4f Compare May 12, 2026 00:40
@EffortlessSteven EffortlessSteven marked this pull request as ready for review May 12, 2026 00:40
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@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.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit 01bcfca into main May 12, 2026
6 checks passed
EffortlessSteven added a commit that referenced this pull request May 12, 2026
TLS contract-pack and public crate-surface cleanup release. Bumps
workspace to 0.8.0. CHANGELOG entry curated from merged PRs:
#485-#605 (TLS lane #585/#587/#588/#589, task-first how-tos
#590-#594, SRP collapse #595/#598/#599/#602, migration guide #603,
Clippy ratchets #505, dep bumps #484-#491).
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