Skip to content

Commit aa74612

Browse files
committed
cargo: Switch to workspace lints
Signed-off-by: Alexandru Vasile <[email protected]>
1 parent beba3a7 commit aa74612

File tree

16 files changed

+49
-39
lines changed

16 files changed

+49
-39
lines changed

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ repository = "https://github.com/paritytech/subxt"
3636
documentation = "https://docs.rs/subxt"
3737
homepage = "https://www.parity.io/"
3838

39+
[workspace.lints.rust]
40+
bad_style = "deny"
41+
improper_ctypes = "deny"
42+
missing_docs = "deny"
43+
non_shorthand_field_patterns = "deny"
44+
no_mangle_generic_items = "deny"
45+
overflowing_literals = "deny"
46+
path_statements = "deny"
47+
patterns_in_fns_without_body = "deny"
48+
unconditional_recursion = "deny"
49+
unused_allocation = "deny"
50+
unused_comparisons = "deny"
51+
unused_parens = "deny"
52+
while_true = "deny"
53+
trivial_casts = "deny"
54+
trivial_numeric_casts = "deny"
55+
unused_crate_dependencies = "deny"
56+
unused_extern_crates = "deny"
57+
58+
[workspace.lints.clippy]
59+
type_complexity = "allow"
60+
all = "deny"
61+
3962
[workspace.dependencies]
4063
async-trait = "0.1.74"
4164
assert_matches = "1.5.0"

cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ description = "Command line utilities for working with subxt codegen"
1616
name = "subxt"
1717
path = "src/main.rs"
1818

19+
[lints]
20+
workspace = true
21+
1922
[features]
2023
# Compute the state root hash from the genesis entry.
2124
# Enable this to create a smaller chain spec file.

cli/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Build script for the CLI.
2+
13
use std::{borrow::Cow, process::Command};
24

35
fn main() {

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
33
// see LICENSE for license details.
44

5-
#![deny(unused_crate_dependencies)]
5+
//! The Subxt CLI tool.
66
77
mod commands;
88
mod utils;

codegen/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ documentation = "https://docs.rs/subxt-codegen"
1212
homepage.workspace = true
1313
description = "Generate an API for interacting with a substrate node from FRAME metadata"
1414

15+
[lints]
16+
workspace = true
17+
1518
[features]
1619
default = []
1720
fetch-metadata = ["dep:jsonrpsee", "dep:tokio", "dep:frame-metadata"]

codegen/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//! This is used by the `#[subxt]` macro and `subxt codegen` CLI command, but can also
77
//! be used directly if preferable.
88
9-
#![deny(unused_crate_dependencies, missing_docs)]
10-
119
mod api;
1210
mod ir;
1311
mod types;

lightclient/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ homepage.workspace = true
1414
description = "Light Client for chain interaction"
1515
keywords = ["parity", "substrate", "blockchain"]
1616

17+
[lints]
18+
workspace = true
19+
1720
[features]
1821
default = ["native"]
1922

lightclient/src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
//!
1111
//! This leverages the smoldot crate to connect to the chain.
1212
13-
#![deny(
14-
missing_docs,
15-
unused_crate_dependencies,
16-
unused_extern_crates,
17-
clippy::all
18-
)]
19-
#![allow(clippy::type_complexity)]
20-
2113
#[cfg(any(
2214
all(feature = "web", feature = "native"),
2315
not(any(feature = "web", feature = "native"))

macro/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ documentation.workspace = true
1313
homepage.workspace = true
1414
description = "Generate types and helpers for interacting with Substrate runtimes."
1515

16+
[lints]
17+
workspace = true
18+
1619
[features]
1720
web = ["subxt-codegen/web"]
1821

macro/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
33
// see LICENSE for license details.
44

5-
extern crate proc_macro;
5+
//! Subxt macro for generating Substrate runtime interfaces.
66
77
use codec::Decode;
88
use darling::{ast::NestedMeta, FromMeta};
@@ -73,7 +73,8 @@ struct SubstituteType {
7373
with: syn::Path,
7474
}
7575

76-
// Note: docs for this are in the subxt library; don't add any here as they will be appended.
76+
// Note: docs for this are in the subxt library; don't add further docs here as they will be appended.
77+
/// The subxt macro.
7778
#[proc_macro_attribute]
7879
#[proc_macro_error]
7980
pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream {

metadata/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ documentation.workspace = true
1313
homepage.workspace = true
1414
description = "Command line utilities for checking metadata compatibility between nodes."
1515

16+
[lints]
17+
workspace = true
18+
1619
[dependencies]
1720
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
1821
frame-metadata = { workspace = true }

metadata/benches/bench.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
33
// see LICENSE for license details.
44

5+
//! Benchmarks for metadata hashing.
6+
57
use codec::Decode;
68
use criterion::*;
79
use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed};

metadata/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
//! 2. Obtaining [`frame_metadata::RuntimeMetadataPrefixed`], and then
1515
//! using `.try_into()` to convert it into [`Metadata`].
1616
17-
#![deny(missing_docs)]
18-
1917
mod from_into;
2018
mod utils;
2119

signer/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
//! Enable the `subxt` feature to enable use of this [`sr25519::Keypair`] in signing
1414
//! subxt transactions for chains supporting sr25519 signatures.
1515
16-
#![deny(missing_docs)]
17-
1816
#[macro_use]
1917
mod utils;
2018
mod crypto;

subxt/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ homepage.workspace = true
1414
description = "Submit extrinsics (transactions) to a substrate node via RPC"
1515
keywords = ["parity", "substrate", "blockchain"]
1616

17+
[lints]
18+
workspace = true
19+
1720
[features]
1821
# For dev and documentation reasons we enable more features than are often desired.
1922
# it's recommended to use `--no-default-features` and then select what you need.

subxt/src/lib.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,6 @@
1010
//!
1111
//! Take a look at [the Subxt guide](book) to learn more about how to use Subxt.
1212
13-
#![deny(
14-
bad_style,
15-
improper_ctypes,
16-
missing_docs,
17-
non_shorthand_field_patterns,
18-
no_mangle_generic_items,
19-
overflowing_literals,
20-
path_statements,
21-
patterns_in_fns_without_body,
22-
unconditional_recursion,
23-
unused_allocation,
24-
unused_comparisons,
25-
unused_parens,
26-
while_true,
27-
trivial_casts,
28-
trivial_numeric_casts,
29-
unused_crate_dependencies,
30-
unused_extern_crates,
31-
clippy::all
32-
)]
33-
#![allow(clippy::type_complexity)]
34-
3513
#[cfg(any(
3614
all(feature = "web", feature = "native"),
3715
not(any(feature = "web", feature = "native"))

0 commit comments

Comments
 (0)