Skip to content

Conversation

@shikhar
Copy link
Member

@shikhar shikhar commented Jan 27, 2026

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

This PR enables clippy::pedantic and clippy::nursery lint groups to improve code quality across the codebase. All changes are stylistic improvements that follow Rust best practices and idioms.

Key improvements:

  • Added numeric separators to large literals (e.g., 1_700_000_000) for better readability
  • Replaced type name repetition with Self in match arms and constructors
  • Removed redundant .clone() calls in test code
  • Inlined format arguments using modern Rust syntax
  • Improved bool-to-int conversion using i64::from()
  • Used Arc::default() for clearer type-specific defaults

Lint configuration:

  • Enabled pedantic and nursery groups with sensible allow overrides
  • Allowed noisy lints like missing_errors_doc, cast_*, and various style preferences
  • Configuration aligns with the project's existing style preferences

The PR includes comprehensive allows for lints that would be too verbose or don't fit the project's coding style. All changes are verified by cargo clippy --all-features --all-targets -- -D warnings passing.

Confidence Score: 5/5

  • This PR is completely safe to merge with zero risk
  • All changes are purely stylistic code improvements from enabling clippy pedantic and nursery lints. No logic changes, no behavior changes, and the test suite passes. The lint configuration is well-considered with appropriate allows for noisy lints.
  • No files require special attention

Important Files Changed

Filename Overview
Cargo.toml Added pedantic and nursery clippy lints with reasonable allow overrides for style preferences
src/cache.rs Improved readability with numeric separators and inlined format args, removed redundant clones
src/service/metrics.rs Replaced bool-to-int conditional with i64::from() conversion

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Clippy as Clippy Linter
    participant Code as Codebase
    
    Dev->>Code: Enable pedantic & nursery lints
    Dev->>Code: Add allow overrides for style preferences
    
    Clippy->>Code: Scan for lint violations
    
    Note over Clippy,Code: Code Quality Improvements
    
    Clippy->>Code: Flag unreadable numeric literals
    Dev->>Code: Add separators (1700000000 → 1_700_000_000)
    
    Clippy->>Code: Flag type name repetition
    Dev->>Code: Use Self instead of type names
    
    Clippy->>Code: Flag redundant clones in tests
    Dev->>Code: Remove unnecessary .clone() calls
    
    Clippy->>Code: Flag uninlined format args
    Dev->>Code: Inline format arguments
    
    Clippy->>Code: Flag bool-to-int pattern
    Dev->>Code: Use i64::from(bool)
    
    Clippy->>Code: Flag Default trait pattern
    Dev->>Code: Use Arc::default()
    
    Clippy->>Code: Re-scan with new config
    Note over Clippy,Code: All warnings resolved ✓
Loading

@shikhar shikhar changed the title Enable pedantic and nursery clippy lints chore: enable pedantic and nursery clippy lints Jan 28, 2026
shikhar and others added 10 commits February 1, 2026 11:22
Enable clippy::pedantic and clippy::nursery lint groups with
reasonable allows for style preferences, intentional casts,
and documentation verbosity.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::unreadable_literal warnings by adding
underscore separators to improve readability of large numbers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::use_self warnings by replacing explicit type
names with Self where applicable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::redundant_clone warnings by removing unnecessary
clone() calls where values are not used after the clone.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::uninlined_format_args warnings by using
inline variable syntax in format! and assert! macros.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::bool_to_int_with_if warning by using
From trait instead of if/else.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses clippy::default_trait_access warning by using
explicit type default method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allow lints for code style preferences where the existing
patterns are acceptable:
- trivially_copy_pass_by_ref: &self pattern on small Copy types
- manual_let_else: complex tuple destructuring
- unnecessary_wraps: Result wrapper for API consistency
- unused_async: async keyword for trait/interface compatibility

Also fix typo in lint name (passable -> pass).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@shikhar shikhar changed the title chore: enable pedantic and nursery clippy lints chore: enable pedantic clippy lints Feb 1, 2026
@shikhar shikhar merged commit 9bb5572 into main Feb 1, 2026
4 checks passed
@shikhar shikhar deleted the clippa branch February 1, 2026 17:05
@github-actions github-actions bot mentioned this pull request Feb 1, 2026
shikhar pushed a commit that referenced this pull request Feb 1, 2026
## 🤖 New release

* `cachey`: 0.9.2 -> 0.9.3

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.9.3](0.9.2...0.9.3)
- 2026-02-01

### Other

- enable pedantic clippy lints
([#50](#50))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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