-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Clippyfy #6341
Clippyfy #6341
Changes from 6 commits
a57a196
00c05ec
c4d80f0
5fc79c9
81fd2a8
d96fd47
c513688
e09df27
0b70674
c27890a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,32 @@ | ||||||||||||||
# | ||||||||||||||
# An auto defined `clippy` feature was introduced, | ||||||||||||||
# but it was found to clash with user defined features, | ||||||||||||||
# so was renamed to `cargo-clippy`. | ||||||||||||||
# | ||||||||||||||
# If you want standard clippy run: | ||||||||||||||
# RUSTFLAGS= cargo clippy | ||||||||||||||
[target.'cfg(feature = "cargo-clippy")'] | ||||||||||||||
rustflags = [ | ||||||||||||||
"-Aclippy::all", | ||||||||||||||
"-Dclippy::correctness", | ||||||||||||||
"-Aclippy::if-same-then-else", | ||||||||||||||
"-Aclippy::clone-double-ref", | ||||||||||||||
"-Dclippy::complexity", | ||||||||||||||
"-Aclippy::zero-prefixed-literal", # 00_1000_000 | ||||||||||||||
"-Aclippy::type_complexity", # raison d'etre | ||||||||||||||
"-Aclippy::nonminimal-bool", # maybe | ||||||||||||||
"-Aclippy::borrowed-box", # Reasonable to fix this one | ||||||||||||||
"-Aclippy::too-many-arguments", # (Turning this on would lead to) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
"-Aclippy::unnecessary_cast", # Types may change | ||||||||||||||
"-Aclippy::identity-op", # One case where we do 0 + | ||||||||||||||
"-Aclippy::useless_conversion", # Types may change | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like these lints were copied from Substrate. But it makes me sad that this is
This lint can be annoying during development as "Types may change", but in CI it should be more strict IMO. That would keep friction to a minimum. Probably this should be a follow-up issue where people can chime in. Super low priority in the grand scheme of things, so let's leave the lints as-is for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That also really depends on people's workflow. I only run clippy manually when I'm done. I.e. that lint wouldn't bother me at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I guess you can just have clippy in your pre-push hook instead of pre-commit. Also I remembered you can |
||||||||||||||
"-Aclippy::unit_arg", # styalistic. | ||||||||||||||
"-Aclippy::option-map-unit-fn", # styalistic | ||||||||||||||
"-Aclippy::bind_instead_of_map", # styalistic | ||||||||||||||
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
"-Aclippy::erasing_op", # E.g. 0 * DOLLARS | ||||||||||||||
"-Aclippy::eq_op", # In tests we test equality. | ||||||||||||||
"-Aclippy::while_immutable_condition", # false positives | ||||||||||||||
"-Aclippy::needless_option_as_deref", # false positives | ||||||||||||||
"-Aclippy::derivable_impls", # false positives | ||||||||||||||
"-Aclippy::stable_sort_primitive", # prefer stable sort | ||||||||||||||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ polkadot.* | |
!polkadot.service | ||
!.rpm/* | ||
.DS_Store | ||
.cargo | ||
.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Interesting history, but unrelated to our codebase, I think this is unneeded.