From d6cb28901ed84f382d0e5933814ebaaf8230a237 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 26 Oct 2023 19:47:57 +0200 Subject: [PATCH] lints: use [workspace.lints] Depends on a newly stabilized feature which will be in 1.75 and available on nightly today https://github.com/rust-lang/cargo/issues/12115#issuecomment-1774225613 --- .cargo/config.toml | 2 +- .github/workflows/ci.yml | 4 +++- Cargo.toml | 7 +++++++ iroh-bytes/Cargo.toml | 3 +++ iroh-gossip/Cargo.toml | 3 +++ iroh-metrics/Cargo.toml | 3 +++ iroh-net/Cargo.toml | 3 +++ iroh-sync/Cargo.toml | 3 +++ iroh-test/Cargo.toml | 3 +++ iroh/Cargo.toml | 3 +++ 10 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 421e48d61a..38bd089b68 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -rustflags = ["-Wmissing_debug_implementations", "-Wclippy::unused-async"] +rustflags = [] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da2ca4c8f8..5f992007a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -272,7 +272,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: dtolnay/rust-toolchain@stable + # Can be switched back once 1.75 lands + # https://github.com/rust-lang/cargo/issues/12115#issuecomment-1768170381 + - uses: dtolnay/rust-toolchain@nightly with: components: clippy diff --git a/Cargo.toml b/Cargo.toml index deb9099a9f..159dfd0ac6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,10 @@ debug-assertions = false opt-level = 3 panic = 'abort' incremental = false + + +[workspace.lints.rust] +missing_debug_implementations = "warn" + +[workspace.lints.clippy] +unused-async = "warn" \ No newline at end of file diff --git a/iroh-bytes/Cargo.toml b/iroh-bytes/Cargo.toml index 0f754c8d59..eb34c76dc3 100644 --- a/iroh-bytes/Cargo.toml +++ b/iroh-bytes/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/n0-computer/iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] anyhow = { version = "1", features = ["backtrace"] } bao-tree = { version = "0.9.1", features = ["tokio_fsm"], default-features = false } diff --git a/iroh-gossip/Cargo.toml b/iroh-gossip/Cargo.toml index 9128c04c72..7e44bf6721 100644 --- a/iroh-gossip/Cargo.toml +++ b/iroh-gossip/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/n0-computer/iroh-sync" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] # proto dependencies (required) anyhow = { version = "1", features = ["backtrace"] } diff --git a/iroh-metrics/Cargo.toml b/iroh-metrics/Cargo.toml index 99ac7e0017..381abccbe2 100644 --- a/iroh-metrics/Cargo.toml +++ b/iroh-metrics/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/n0-computer/iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] prometheus-client = { version = "0.21.0", optional = true } once_cell = "1.17.0" diff --git a/iroh-net/Cargo.toml b/iroh-net/Cargo.toml index 7791a742b9..970435cacd 100644 --- a/iroh-net/Cargo.toml +++ b/iroh-net/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/n0-computer/iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] aead = { version = "0.5.2", features = ["bytes"] } anyhow = { version = "1", features = ["backtrace"] } diff --git a/iroh-sync/Cargo.toml b/iroh-sync/Cargo.toml index c39bb4ddbd..0b955a0e24 100644 --- a/iroh-sync/Cargo.toml +++ b/iroh-sync/Cargo.toml @@ -11,6 +11,9 @@ repository = "https://github.com/n0-computer/iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] anyhow = "1" blake3 = { package = "iroh-blake3", version = "1.4.3"} diff --git a/iroh-test/Cargo.toml b/iroh-test/Cargo.toml index 35dd2b1a18..149a04f89b 100644 --- a/iroh-test/Cargo.toml +++ b/iroh-test/Cargo.toml @@ -12,6 +12,9 @@ publish = true # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] anyhow = "1" tokio = { version = "1", features = ["full"] } diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml index 7504928e05..8cc4985d05 100644 --- a/iroh/Cargo.toml +++ b/iroh/Cargo.toml @@ -12,6 +12,9 @@ default-run = "iroh" # Sadly this also needs to be updated in .github/workflows/ci.yml rust-version = "1.72" +[lints] +workspace = true + [dependencies] anyhow = { version = "1", features = ["backtrace"] } bao-tree = { version = "0.9.1", features = ["tokio_fsm"], default-features = false }