Skip to content

Enforce additional clippy lints #235

@ricochet

Description

@ricochet

Enforce additional clippy lints in Cargo.toml and have crates inherit.

[lints.clippy]
# Correctness & Safety
unwrap_used = "warn"          # Prefer expect() or proper error handling
expect_used = "warn"          # Even stricter - force Result handling
panic = "warn"                # No panics in library code
indexing_slicing = "warn"     # Use .get() instead of [i]

# Performance
inefficient_to_string = "warn"
needless_collect = "warn"
needless_pass_by_value = "warn"
trivially_copy_pass_by_ref = "warn"
unnecessary_box_returns = "warn"

# Code Quality
clone_on_ref_ptr = "warn"     # Explicit Arc::clone() over .clone()
dbg_macro = "warn"            # No dbg! in production
print_stdout = "warn"         # No println! in libraries
todo = "warn"                 # No TODO in production

cargo clippy -- -W clippy::pedantic 2>&1 | grep -o -i warning | wc -l came in at 735. So I do not recommend starting there.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions