Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo: Switch to workspace lints #1299

Merged
merged 14 commits into from
Dec 4, 2023
Merged
27 changes: 27 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,30 @@ jobs:
with:
command: clippy
args: --all-targets -- -D warnings
machete:
name: "Cargo machete"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Use substrate-node binary
uses: ./.github/workflows/actions/use-substrate

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Rust Cache
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1

- name: Install cargo-machete
run: cargo install cargo-machete

- name: Run tests
lexnv marked this conversation as resolved.
Show resolved Hide resolved
uses: actions-rs/cargo@v1.0.3
with:
command: machete
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,31 @@ resolver = "2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
version = "0.32.1"
rust-version = "1.70.0"
rust-version = "1.74.0"
license = "Apache-2.0 OR GPL-3.0"
repository = "https://github.com/paritytech/subxt"
documentation = "https://docs.rs/subxt"
homepage = "https://www.parity.io/"

[workspace.lints.rust]
bad_style = "deny"
improper_ctypes = "deny"
missing_docs = "deny"
non_shorthand_field_patterns = "deny"
no_mangle_generic_items = "deny"
overflowing_literals = "deny"
path_statements = "deny"
patterns_in_fns_without_body = "deny"
unconditional_recursion = "deny"
unused_allocation = "deny"
unused_comparisons = "deny"
unused_parens = "deny"
unused_extern_crates = "deny"

[workspace.lints.clippy]
type_complexity = "allow"
all = "deny"

[workspace.dependencies]
async-trait = "0.1.74"
assert_matches = "1.5.0"
Expand Down Expand Up @@ -124,3 +143,12 @@ secp256k1 = "0.28.0"
secrecy = "0.8.0"
sha2 = "0.10.8"
zeroize = { version = "1", default-features = false }

[profile.dev.package.smoldot-light]
opt-level = 2
[profile.test.package.smoldot-light]
opt-level = 2
[profile.dev.package.smoldot]
opt-level = 2
[profile.test.package.smoldot]
opt-level = 2
3 changes: 3 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ description = "Command line utilities for working with subxt codegen"
name = "subxt"
path = "src/main.rs"

[lints]
workspace = true

[features]
# Compute the state root hash from the genesis entry.
# Enable this to create a smaller chain spec file.
Expand Down
2 changes: 2 additions & 0 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Build script for the CLI.

use std::{borrow::Cow, process::Command};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.

#![deny(unused_crate_dependencies)]
//! The Subxt CLI tool.

mod commands;
mod utils;
Expand Down
1 change: 1 addition & 0 deletions codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ documentation = "https://docs.rs/subxt-codegen"
homepage.workspace = true
description = "Generate an API for interacting with a substrate node from FRAME metadata"


[features]
default = []
fetch-metadata = ["dep:jsonrpsee", "dep:tokio", "dep:frame-metadata"]
Expand Down
Loading
Loading