near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 618 forks source link

Enable clippy on CI #8145

Open akhi3030 opened 1 year ago

akhi3030 commented 1 year ago

This issue tracks clippy adoption as part of nearcore CI.

We've decided to gradually enable clippy starting from the most useful checks (see the discussion here for more context).

clippy is currently executed as part of buildkite sanity checks step via run_clippy script.

Done:

Next:

nagisa commented 1 year ago

I suggest that we enable the following lints at some point:

As a more general strategy note, I don’t believe wholesale enabling any of the groups outside suspicious and correctness makes sense. I think each lint should be denied and listed individually in run_clippy.sh, even if the end result is denial of the entire category anyway. Doing it that way means that it is easy to add or remove individual lints in the future as our opinions of their benefits changes. It also avoids sustaining as many breaking changes on toolchain upgrades as clippy adds more lints in the existing categories.

Another thing to do is to look through our STYLE.md document and see if there are any lints in clippy that would force those rules.