Skip to content

Commit

Permalink
Set clippy lints in workspace (requires rust 1.74) (paritytech#2390)
Browse files Browse the repository at this point in the history
We currently use a bit of a hack in `.cargo/config` to make sure that
clippy isn't too annoying by specifying the list of lints.

There is now a stable way to define lints for a workspace. The only down
side is that every crate seems to have to opt into this so there's a
*few* files modified in this PR.

Dependencies:

- [x] PR that upgrades CI to use rust 1.74 is merged.

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
  • Loading branch information
4 people authored Dec 13, 2023
1 parent 301db49 commit 006b831
Show file tree
Hide file tree
Showing 283 changed files with 848 additions and 0 deletions.
3 changes: 3 additions & 0 deletions substrate/bin/minimal/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ publish = false
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"
build = "build.rs"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/minimal/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ repository.workspace = true
license.workspace = true
publish = false

[lints]
workspace = true

[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ publish = false
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"
build = "build.rs"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node-template/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "MIT-0"
publish = false
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "MIT-0"
publish = false
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
# https://github.com/rustwasm/wasm-pack/issues/781 etc.
Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://substrate.io"
repository.workspace = true

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/utils/chain-spec-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/bin/utils/subkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description = "Collection of allocator implementations."
documentation = "https://docs.rs/sc-allocator"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description = "Substrate client interfaces."
documentation = "https://docs.rs/sc-client-api"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
description = "Substrate authority discovery."
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/basic-authorship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Basic implementation of block-authoring logic."
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/block-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate block builder"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/chain-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate chain configurations."
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/chain-spec/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ homepage = "https://substrate.io"
repository.workspace = true
description = "Macros to derive chain spec extension traits implementation."

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
documentation = "https://docs.rs/sc-consensus-babe"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/babe/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ repository.workspace = true
description = "BEEFY Client gadget for substrate"
homepage = "https://substrate.io"

[lints]
workspace = true

[dependencies]
array-bytes = "6.1"
async-channel = "1.8.0"
Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/beefy/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ repository.workspace = true
description = "RPC for the BEEFY Client gadget for substrate"
homepage = "https://substrate.io"

[lints]
workspace = true

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
futures = "0.3.21"
Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Collection of common consensus specific imlementations for Substrate (client)"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/epochs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description = "Integration of the GRANDPA finality gadget into substrate."
documentation = "https://docs.rs/sc-consensus-grandpa"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/grandpa/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
readme = "README.md"
homepage = "https://substrate.io"

[lints]
workspace = true

[dependencies]
finality-grandpa = { version = "0.16.2", features = ["derive-codec"] }
futures = "0.3.16"
Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/manual-seal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/pow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/consensus/slots/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Client backend that uses RocksDB database as storage."
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description = "A crate that provides means of executing/dispatching calls into t
documentation = "https://docs.rs/sc-executor"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/executor/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description = "A set of common definitions that are needed for defining executio
documentation = "https://docs.rs/sc-executor-common/"
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/executor/runtime-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ publish = false
homepage = "https://substrate.io"
repository.workspace = true

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/executor/wasmtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
description = "Defines a `WasmRuntime` that uses the Wasmtime JIT to execute."
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
3 changes: 3 additions & 0 deletions substrate/client/informant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository.workspace = true
readme = "README.md"

[lints]
workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

Expand Down
Loading

0 comments on commit 006b831

Please sign in to comment.