gitoxide icon indicating copy to clipboard operation
gitoxide copied to clipboard

OCD: Satisfy some pedantic clippies

Open nyurik opened this issue 1 year ago • 5 comments

I just ran cargo clippy --workspace --tests --bins --lib --benches --examples -- -W clippy::pedantic 2>&1 | rg --trim -- '-W clippy::' | sort | uniq -c | sort -h -r and got this list of currently failing pedantic issues (reformatted). Some probably should not be implemented. The command above uses ripgrep.

  • [ ] x52 clippy::semicolon-if-nothing-returned ~- [ ] x48 clippy::must-use-candidate~ ~- [ ] x44 clippy::missing-errors-doc~
  • [ ] x36 clippy::redundant-closure-for-method-calls
  • [ ] x172 clippy::unwrap_used
  • [ ] x36 clippy::default-trait-access
  • [x] x33 clippy::doc-markdown #876
  • [x] ~~x29 clippy::enum-glob-use~~ #903
  • [ ] x28 clippy::items-after-statements
  • [ ] x27 clippy::needless-pass-by-value
  • [ ] x26 clippy::too-many-lines
  • [ ] x21 clippy::missing-panics-doc
  • [ ] x19 clippy::single-match-else
  • [ ] x16 clippy::unnecessary-wraps
  • [x] x16 clippy::implicit-clone #873
  • [ ] x15 clippy::return-self-not-must-use
  • [ ] x15 clippy::module-name-repetitions
  • [ ] x15 clippy::match-same-arms
  • [ ] x13 clippy::unreadable-literal
  • [ ] x13 clippy::cast-possible-truncation
  • [ ] x11 clippy::similar-names
  • [ ] x11 clippy::redundant-else
  • [ ] x11 clippy::if-not-else
  • [ ] x11 clippy::cast-lossless
  • [ ] x8 clippy::trivially-copy-pass-by-ref
  • [ ] x8 clippy::struct-excessive-bools
  • [ ] x7 clippy::match-wildcard-for-single-variants
  • [ ] x7 clippy::explicit-into-iter-loop
  • [ ] x6 clippy::cast-precision-loss
  • [ ] x5 clippy::manual-string-new
  • [ ] x5 clippy::inconsistent-struct-constructor
  • [ ] x5 clippy::from-iter-instead-of-collect
  • [ ] x5 clippy::cast-sign-loss
  • [ ] x4 clippy::wildcard-imports
  • [ ] x4 clippy::inefficient-to-string
  • [x] x4 clippy::cloned-instead-of-copied #875
  • [ ] x3 clippy::used-underscore-binding
  • [ ] x3 clippy::unused-self
  • [ ] x3 clippy::let-underscore-untyped
  • [ ] x3 clippy::explicit-deref-methods
  • [ ] x3 clippy::cast-possible-wrap
  • [ ] x2 clippy::range-plus-one
  • [ ] x2 clippy::match-wild-err-arm
  • [ ] x2 clippy::iter-not-returning-iterator
  • [ ] x2 clippy::inline-always
  • [ ] x2 clippy::flat-map-option
  • [ ] x2 clippy::borrow-as-ptr
  • [ ] x1 clippy::unsafe-derive-deserialize
  • [ ] x1 clippy::unnecessary-join
  • [ ] x1 clippy::transmute-ptr-to-ptr
  • [ ] x1 clippy::no-effect-underscore-binding
  • [ ] x1 clippy::mut-mut
  • [ ] x1 clippy::match-bool
  • [ ] x1 clippy::manual-assert
  • [ ] x1 clippy::filter-map-next
  • [ ] x1 clippy::copy-iterator
  • [ ] x1 clippy::checked-conversions
  • [ ] x1 clippy::bool-to-int-with-if

nyurik avatar May 26 '23 07:05 nyurik

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 :).

Byron avatar May 26 '23 07:05 Byron

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 :)

nyurik avatar May 26 '23 17:05 nyurik

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

poliorcetics avatar Jun 18 '23 20:06 poliorcetics

clippy::default-trait-access

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

poliorcetics avatar Jun 18 '23 20:06 poliorcetics

clippy::enum-glob-use

Refused in #903, should be crossed out

poliorcetics avatar Jun 22 '23 08:06 poliorcetics

This list has been updated with the new generation method

nyurik avatar Aug 24 '24 06:08 nyurik