rust-bitcoin / rust-bitcoin/rust-bitcoin
Even more clippy lints could be turned on
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 1k
- Avg merge
- 4d 39m
- Merged PRs (30d)
- 86
Description
> I put them in the `units` manifest.
Sounds good! Let's dig a bit further when we do the second crate to see if we can de-dupe.
Some more lints I think we should add, maybe in a followup:
cargo_common_metadataclear_with_drainclone_on_ref_ptr(forces explicit Arc::clone when cloning Arcs, which IMO is good style)collection_is_never_readdebug_assert_with_mut_call- Maybe
decimal_literal_representation... this e.g. complains if you write 32768 instead of0x8000. deref_by_slicingequatable_if_let(IMO this is good style, but you may disagree)empty_structs_with_brackets- Maybe
else_if_without_else... this isa MISRA C guideline and also I dated a girl a long time ago who told me to do this fallible_impl_from(should lint panics inFrom, a pet peeve of Kix's)float_arithmeticlints any use of float arithmetic ... maybe have this as warn and whitelist specific modules?fn_to_numeric_cast_anyimprecise_flops(improve FP accuracy, though maybe at expense of performance)large_stack_frames(goes withlarge_stack_array)manual_clamp(goes with othermanual_*lints we already have)non_ascii_idents(this is actually a rustc lint now... unsure if it's on by default)- Maybe
pattern_type_mismatch(this is a personal pet peeve of mine, YMMV) - Maybe
multiple_inherent_implandmodule_name_repetitions.. unsure needless_collectstring_add(goes withstring_add_assign)std_instead_of_core,std_instead_of_alloc,alloc_instead_of_corewhich lints imports from too-strong a placesignificant_drop_tightening(suggests moving mutex drops up) and maybesignificant_drop_in_scrutinee(not really sure what this does)i
There is also missing_enforced_import_renames which requires explicit configuration.
There is also arithmetic_side_effects which lints all potentially-panicking arithmetic. Can be configured. May be worth exploring or maybe just way too noisy.
Originally posted by @apoelstra in https://github.com/rust-bitcoin/rust-bitcoin/issues/3704#issuecomment-2541736964
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the units manifest and the repository's existing Clippy lint configuration. Review the listed lints and their configuration needs, then determine which are appropriate for the second crate; done means the selected lints are enabled without unacceptable warnings or noise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100