Skip to content

Conversation

@DCNick3
Copy link
Contributor

@DCNick3 DCNick3 commented Sep 20, 2023

TL;DR: use cargo clippy -Zlints --workspace --benches --tests --examples --all-features instead of cargo lints. Also you can permanently enable the -Zlints for your IDE by putting the following into .cargo/config.toml:

[unstable]
lints = true

Description

Since the implementation of rust-lang/rfcs#3389, it is now possible to specify workspace-level lints for rustc and clippy. This PR updates the cargo configuration and CI to use this new feature instead of cargo-lints.

Note that it was only stabilized in nightly-2023-09-10. Using it with out current toolchain requires either a -Zlints flag or a modification to .cargo/config.toml:

[unstable]
lints = true

Also note that unlike the original suggestion in #3622, this doesn't make the lints crate-level, but merely replaces a clunky unmaintained tool with a standard solution for configuring lints.

In particular, this PR:

  • Removes old lints.toml configuration files for cargo-lints
  • Adds [lint] tables to Cargo.toml of the root and wasm workspaces. The lints are duplicated between the two
  • Replaces cargo lints clippy invocations with cargo clippy -Zlints in CI scripts
  • Silences/fixes some new lints that popped up due to differences in how between cargo lints and workspaces
  • Does a drive-by fix to iroha_genesis: it now too shares cargo metadata as do other crates

Checklist

  • Make sure it passes CI

…intained cargo-lints

Since the implementation of rust-lang/rfcs#3389, it is now possible to specify workspace-level lints for rustc and clippy. This PR updates the cargo configuration and CI to use this new feature instead of cargo-lints.

Note that it was only stabilized in `nightly-2023-09-10`. Using it with out current toolchain requires either a -Zlints flag or a modification to `.cargo/config.toml`:

```
[unstable]
lints = true
```

Note that unlike the original suggestion in hyperledger-iroha#3622, this doesn't make the lints crate level, but merely replaces a clunky unmaintained tool with a standard solution for configuring lints.

In particular this PR:
- Removes old lints.toml configuration files for cargo-lints
- Adds [lint] tables to Cargo.toml of the root and wasm workspaces. The lints are duplicated between the two
- Replaces `cargo lints clippy` invocations with `cargo clippy -Zlints` in CI scripts
- Silences/fixes some new lints that popped up due to differences in how between `cargo lints` and workspaces
- Does a drive-by fix to iroha_genesis: it now too shares cargo metadata as do other crates

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Sep 20, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6248525463

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6111 unchanged lines in 102 files lost coverage.
  • Overall coverage decreased (-1.1%) to 58.327%

Files with Coverage Reduction New Missed Lines %
cli/src/main.rs 1 0.0%
cli/src/torii/pagination.rs 1 98.9%
config/base/src/runtime_upgrades.rs 1 51.72%
config/src/torii.rs 1 96.67%
core/src/smartcontracts/isi/block.rs 1 87.5%
crypto/src/merkle.rs 1 96.23%
data_model/derive/src/partially_tagged.rs 1 99.67%
data_model/src/domain.rs 1 47.37%
logger/src/lib.rs 1 95.15%
config/src/lib.rs 2 0.0%
Totals Coverage Status
Change from base Build 5423219773: -1.1%
Covered Lines: 21419
Relevant Lines: 36722

💛 - Coveralls

Copy link
Contributor

@Erigara Erigara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@DCNick3 DCNick3 merged commit dc5b0f3 into hyperledger-iroha:iroha2-dev Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iroha2-dev The re-implementation of a BFT hyperledger in RUST

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants