Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCD: Satisfy some pedantic clippies #874

Closed
2 of 64 tasks
nyurik opened this issue May 26, 2023 · 6 comments · Fixed by #1550
Closed
2 of 64 tasks

OCD: Satisfy some pedantic clippies #874

nyurik opened this issue May 26, 2023 · 6 comments · Fixed by #1550
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues

Comments

@nyurik
Copy link
Contributor

nyurik commented May 26, 2023

This is a (infrequently updated) list of the failing pedantic issues. Some probably should not be implemented.

To regenerate, use this bash command with jq:

cargo clippy --all-targets --workspace --message-format=json --quiet -- -W clippy::pedantic \
   | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' \
   | sort | uniq -c | sort -h -r
  • x709 clippy::default_trait_access
  • x552 clippy::doc_markdown Cleaning up documentation #876
  • x457 clippy::semicolon_if_nothing_returned Add missing semicolons #1546
  • x447 clippy::missing_panics_doc
  • x216 clippy::cast_possible_truncation
  • x205 clippy::needless_pass_by_value
  • x204 clippy::return_self_not_must_use
  • x169 clippy::unreadable_literal
  • x164 clippy::items_after_statements
  • x162 clippy::single_match_else
  • x161 clippy::too_many_lines
  • x125 clippy::module_name_repetitions
  • x110 clippy::unnecessary_wraps
  • x99 clippy::match_same_arms
  • x91 clippy::cast_lossless Fix clippy::cast_lossless #1547
  • x80 clippy::ignored_unit_patterns
  • x75 clippy::used_underscore_binding
  • x75 clippy::needless_raw_string_hashes
  • x70 clippy::implicit_clone Apply -W clippy::implicit-clone and docs #873
  • x64 clippy::manual_let_else
  • x56 clippy::cast_precision_loss
  • x43 clippy::trivially_copy_pass_by_ref
  • x42 clippy::redundant_else
  • x37 clippy::if_not_else
  • x35 clippy::match_wildcard_for_single_variants
  • x35 clippy::cast_sign_loss
  • x32 clippy::similar_names
  • x29 clippy::struct_excessive_bools
  • x26 clippy::cast_possible_wrap
  • x24 clippy::explicit_iter_loop
  • x22 clippy::explicit_into_iter_loop
  • x22 clippy::explicit_deref_methods
  • x18 clippy::inconsistent_struct_constructor
  • x17 clippy::range_plus_one
  • x14 clippy::inefficient_to_string
  • x13 clippy::from_iter_instead_of_collect
  • x10 clippy::unused_self
  • x10 clippy::many_single_char_names
  • x10 clippy::manual_string_new
  • x10 clippy::iter_not_returning_iterator
  • x9 clippy::option_option
  • x8 clippy::inline_always
  • x7 clippy::manual_assert
  • x6 clippy::iter_without_into_iter
  • x6 clippy::copy_iterator
  • x5 clippy::should_panic_without_expect
  • x4 clippy::transmute_ptr_to_ptr
  • x4 clippy::match_wild_err_arm
  • x4 clippy::manual_is_variant_and
  • x4 clippy::bool_to_int_with_if
  • x3 clippy::struct_field_names
  • x2 clippy::wildcard_imports
  • x2 clippy::needless_for_each
  • x2 clippy::naive_bytecount
  • x2 clippy::mut_mut
  • x2 clippy::match_bool
  • x2 clippy::fn_params_excessive_bools
  • x2 clippy::filter_map_next
  • x2 clippy::checked_conversions
  • x2 clippy::borrow_as_ptr
  • x1 clippy::unnecessary_join
  • x1 clippy::stable_sort_primitive
  • x1 clippy::no_effect_underscore_binding

Done/Ignored

@Byron Byron added the C-tracking-issue An issue to track to track the progress of multiple PRs or issues label May 26, 2023
@Byron
Copy link
Member

Byron commented May 26, 2023

Thanks for your involvement and enthusiasm to make the codebase better! It's good to see that not all of these have to be implemented 'just to be implemented', but overall the goal here is to make the code more readable and more idiomatic (which probably is another way of saying the same thing, who knows).

With that said, I hope you don't mind owning this tracking ticket, and you are welcome to work on it as well :).

@nyurik
Copy link
Contributor Author

nyurik commented May 26, 2023

Thx @Byron , I will (slowly) try to hack on these. One of my "side goals" is to improve Clippy itself, so working on a large code base like yours allows one to spot issues there. Also, the side benefit is that it helps optimize the size and performance of the codebase itself, so we all win :)

@poliorcetics
Copy link
Contributor

clippy::redundant-closure-for-method-calls has been done

@poliorcetics
Copy link
Contributor

clippy::default-trait-access

I find this one really noisy for nor much gain, I'm going to skip it

@poliorcetics
Copy link
Contributor

clippy::enum-glob-use

Refused in #903, should be crossed out

This was referenced Aug 24, 2024
@nyurik
Copy link
Contributor Author

nyurik commented Aug 24, 2024

This list has been updated with the new generation method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants