Zebra: Decide how to handle new nightly clippy lints

Created on 16 Nov 2020  路  6Comments  路  Source: ZcashFoundation/zebra

Is your feature request related to a problem? Please describe.

Nightly clippy has some new lints:

  • field_reassign_with_default
  • from_iter_instead_of_collect
  • unnecessary_wraps

PRs #1303 and #1403 disable these lints, but we might actually want to make the recommended changes, then re-enable them.

Describe the solution you'd like

  1. Decide if we want to make the changes recommended by each of these lints.
  2. Make the changes.
  3. Re-enable the lints.
  4. Also remove clippy::unknown_clippy_lints, which was needed to avoid a warning on clippy stable

Describe alternatives you've considered

Don't make the recommended changes.

C-enhancement

All 6 comments

Ping @dconnolly - you seemed interested in making these changes.
(But they're not urgent at all.)

We removed nightly clippy from our CI as part of #1212, but these lints are still relevant.

@hdevalence and @yaahc seem to disagree about the best design here:

I'd prefer if we didn't add clippy annotations to every file and used our existing clippy.toml instead
https://github.com/ZcashFoundation/zebra/pull/1412#pullrequestreview-542114902

My feeling is that we should restrict the scope of disabling this lint to the minimum scope we can, rather than blanket ignoring in every crate.
https://github.com/ZcashFoundation/zebra/pull/1403#issuecomment-736036818

I don't have a particularly strong opinion here, and it's not urgent that we fix this.

I did a little digging and I'm not even sure that it's possible to enable or disable clippy lints via clippy.toml, it seems to be only for configuration values for specific lints. We might have to use a .cargo/config to be able to do this.

OK, I have no strong feelings about this.

We've taken a best-effort approach to nightly clippy lints - if a developer wants to use nightly, they can submit a PR to fix or disable any new lints.

Was this page helpful?
0 / 5 - 0 ratings