Skip to content

lint: add nursery group, restriction lints, and Rust-level lints#155

Merged
sachiniyer merged 1 commit intomainfrom
lint/nursery-and-restrictions
Mar 7, 2026
Merged

lint: add nursery group, restriction lints, and Rust-level lints#155
sachiniyer merged 1 commit intomainfrom
lint/nursery-and-restrictions

Conversation

@sachiniyer
Copy link
Contributor

@sachiniyer sachiniyer commented Mar 7, 2026

Summary

  • Enable clippy::nursery as deny — catches missing_const_for_fn, option_if_let_else, or_fun_call, and more
  • Add 44 restriction lints as deny — comprehensive set covering safety (string_slice, get_unwrap, exit, mem_forget), correctness (undocumented_unsafe_blocks, float_cmp_const, infinite_loop), and style (unseparated_literal_suffix, needless_raw_strings, format_push_string)
  • Add 6 Rust-level lints as deny — trivial_casts, trivial_numeric_casts, unused_qualifications, unused_import_braces, unused_lifetimes, variant_size_differences
  • Allow 2 noisy lints: let_underscore_must_use (intentional let _ = on terminal writes), impl_trait_in_params (overly pedantic for CLI)

Violations fixed

  • Added const fn to 12 pure functions across types, sort_state, render, upgrade, utils, lib
  • Converted if let/else to map_or/map_or_else (3 sites)
  • unwrap_or with function call → unwrap_or_else (1 site)
  • Separated literal suffixes: 100u8100_u8, 0usize0_usize, etc.
  • Replaced string slice indexing with safe .get() in auth.rs
  • Moved SAFETY comment after #[allow] for undocumented_unsafe_blocks
  • Removed unnecessary chrono:: qualification in test

Test plan

  • cargo clippy — 0 warnings, 0 errors
  • cargo test — 139 tests pass
  • cargo fmt --check — clean
  • CI passes

🤖 Generated with Claude Code


Open with Devin

Enable clippy::nursery as deny. Add 44 restriction lints as deny,
with allow for let_underscore_must_use and impl_trait_in_params.
Add Rust lints: trivial_casts, trivial_numeric_casts,
unused_qualifications, unused_import_braces, unused_lifetimes,
variant_size_differences.

Fix all violations: add const fn where possible, use map_or_else
for option_if_let_else, fix unseparated literal suffixes, replace
string slice indexing with safe get(), fix unused qualifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@sachiniyer sachiniyer merged commit 145fd7e into main Mar 7, 2026
11 checks passed
@sachiniyer sachiniyer deleted the lint/nursery-and-restrictions branch March 7, 2026 02:47
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