Set clippy lints in workspace (requires rust 1.74) (#2390)

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>
This commit is contained in:
Squirrel
2023-12-13 14:11:07 +00:00
committed by GitHub
parent 4c4407a893
commit be8e626806
471 changed files with 1430 additions and 37 deletions
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate runtime api primitives"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Macros for declaring and implementing runtime apis."
documentation = "https://docs.rs/sp-api-proc-macro"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -8,6 +8,9 @@ publish = false
homepage = "https://substrate.io"
repository.workspace = true
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ repository.workspace = true
documentation = "https://docs.rs/sp-application-crypto"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
@@ -10,6 +10,9 @@ description = "Minimal fixed point arithmetic primitives and types for runtime."
documentation = "https://docs.rs/sp-arithmetic"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Fuzzer for fixed point arithmetic primitives."
documentation = "https://docs.rs/sp-arithmetic-fuzzer"
publish = false
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "The block builder runtime api."
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Substrate blockchain traits and primitives."
documentation = "https://docs.rs/sp-blockchain"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
@@ -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"]
@@ -8,6 +8,9 @@ homepage = "https://substrate.io"
repository.workspace = true
description = "Primitives for BEEFY protocol."
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Common utilities for building and using consensus engines in subs
documentation = "https://docs.rs/sp-consensus/"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Primitives for GRANDPA integration, suitable for WASM compilation
documentation = "https://docs.rs/sp-consensus-grandpa"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
@@ -11,6 +11,9 @@ documentation = "https://docs.rs/sp-consensus-sassafras"
readme = "README.md"
publish = false
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Shareable Substrate types."
documentation = "https://docs.rs/sp-core"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -3,6 +3,9 @@ name = "sp-core-fuzz"
version = "0.0.0"
publish = false
[lints]
workspace = true
[package.metadata]
cargo-fuzz = true
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Primitive core crate hashing implementation."
documentation = "https://docs.rs/sp-core-hashing"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "This crate provides procedural macros for calculating static hash."
documentation = "https://docs.rs/sp-core-hashing-proc-macro"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -8,6 +8,9 @@ license = "Apache-2.0"
homepage = "https://substrate.io"
repository.workspace = true
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ description = "Substrate database trait."
documentation = "https://docs.rs/sp-database"
readme = "README.md"
[lints]
workspace = true
[dependencies]
kvdb = "0.13.0"
parking_lot = "0.12.1"
@@ -9,6 +9,8 @@ repository.workspace = true
description = "Macros to derive runtime debug implementation."
documentation = "https://docs.rs/sp-debug-derive"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Substrate externalities abstraction"
documentation = "https://docs.rs/sp-externalities"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate GenesisConfig builder API"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Provides types and traits for creating and checking inherents."
documentation = "https://docs.rs/sp-inherents"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -11,6 +11,9 @@ documentation = "https://docs.rs/sp-io"
readme = "README.md"
build = "build.rs"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ description = "Keyring support code for the runtime. A set of test accounts."
documentation = "https://docs.rs/sp-keyring"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Keystore primitives."
documentation = "https://docs.rs/sp-core"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Handling of blobs, usually Wasm code, which may be compresed"
documentation = "https://docs.rs/sp-maybe-compressed-blob"
readme = "README.md"
[lints]
workspace = true
[dependencies]
thiserror = "1.0"
zstd = { version = "0.12.4", default-features = false }
@@ -8,6 +8,9 @@ homepage = "https://substrate.io"
repository.workspace = true
description = "Merkle Mountain Range primitives."
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Intermediate representation of the runtime metadata."
documentation = "https://docs.rs/sp-metadata-ir"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "NPoS election algorithm primitives"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Fuzzer for phragmén implementation."
documentation = "https://docs.rs/sp-npos-elections-fuzzer"
publish = false
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -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"]
@@ -10,6 +10,9 @@ description = "Custom panic hook with bug report link"
documentation = "https://docs.rs/sp-panic-handler"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate RPC primitives and utilities."
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Substrate runtime interface"
documentation = "https://docs.rs/sp-runtime-interface/"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "This crate provides procedural macros for usage within the context of the Substrate runtime interface."
documentation = "https://docs.rs/sp-runtime-interface-proc-macro"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
@@ -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"]
@@ -8,6 +8,9 @@ publish = false
homepage = "https://substrate.io"
repository.workspace = true
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ description = "Runtime Modules shared primitive types."
documentation = "https://docs.rs/sp-runtime"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Primitives for sessions"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "A crate which contains primitives that are useful for implementation that uses staking approaches in general. Definitions related to sessions, slashing, etc go here."
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ repository.workspace = true
documentation = "https://docs.rs/sp-state-machine"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "A crate which contains primitives related to the statement store"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ description = "Lowest-abstraction level for the Substrate runtime: just exports
documentation = "https://docs.rs/sp-std"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ repository.workspace = true
documentation = "https://docs.rs/sp-storage/"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -8,6 +8,9 @@ homepage = "https://substrate.io"
repository.workspace = true
publish = false
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Substrate core types and inherents for timestamps."
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Instrumentation primitives and macros for Substrate."
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
# let's default to wasm32
default-target = "wasm32-unknown-unknown"
@@ -10,6 +10,9 @@ description = "Transaction pool runtime facing API."
documentation = "https://docs.rs/sp-transaction-pool"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -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"]
+3
View File
@@ -10,6 +10,9 @@ homepage = "https://substrate.io"
documentation = "https://docs.rs/sp-trie"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -10,6 +10,9 @@ description = "Version module for the Substrate runtime; Provides a function tha
documentation = "https://docs.rs/sp-version"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Macro for defining a runtime version."
documentation = "https://docs.rs/sp-api-proc-macro"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
@@ -10,6 +10,9 @@ description = "Types and traits for interfacing between the host and the wasm ru
documentation = "https://docs.rs/sp-wasm-interface"
readme = "README.md"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
+3
View File
@@ -9,6 +9,9 @@ repository.workspace = true
description = "Types and traits for interfacing between the host and the wasm runtime."
documentation = "https://docs.rs/sp-wasm-interface"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]