diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 8c1349f4bc0..00000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,3 +0,0 @@ -[alias] -# Temporary solution to have clippy config in a single place until https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md#lintstoml-configuration is shipped. -custom-clippy = "clippy --workspace --all-features --all-targets -- -A clippy::type_complexity -A clippy::pedantic -W clippy::used_underscore_binding -W unreachable_pub" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 280ff63c85e..6057394c600 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,8 +200,9 @@ jobs: fail-fast: false matrix: rust-version: [ - 1.72.0, # current stable - beta + # 1.72.0, # current stable + # beta, + nightly-2023-09-10 ] steps: - uses: actions/checkout@v4 @@ -218,7 +219,7 @@ jobs: save-if: ${{ github.ref == 'refs/heads/master' }} - name: Run cargo clippy - run: cargo custom-clippy # cargo alias to allow reuse of config locally + run: cargo clippy ipfs-integration-test: name: IPFS Integration tests diff --git a/Cargo.toml b/Cargo.toml index d4cc2e337b5..55129a8ea96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,3 +128,9 @@ multihash = "0.19.1" # we import via `rust-multiaddr`. # This is expected to stay here until we move `libp2p-identity` to a separate repository which makes the dependency relationship more obvious. libp2p-identity = { path = "identity" } + +[workspace.lints] +rust.unreachable_pub = "warn" +clippy.used_underscore_binding = "warn" +clippy.pedantic = "allow" +clippy.type_complexity = "allow" diff --git a/core/Cargo.toml b/core/Cargo.toml index ecf3c153312..15288a48d1c 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -35,9 +35,9 @@ void = "1" [dev-dependencies] async-std = { version = "1.6.2", features = ["attributes"] } -libp2p-mplex = { path = "../muxers/mplex" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-noise = { path = "../transports/noise" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -multihash = { workspace = true , features = ["arb"] } +libp2p-mplex = { path = "../muxers/mplex" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-noise = { path = "../transports/noise" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +multihash = { workspace = true, features = ["arb"] } quickcheck = { workspace = true } libp2p-identity = { workspace = true, features = ["ed25519"] } @@ -50,3 +50,6 @@ serde = ["multihash/serde-codec", "dep:serde", "libp2p-identity/serde"] all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/examples/autonat/Cargo.toml b/examples/autonat/Cargo.toml index 4b9ab5aa465..332f77f04a7 100644 --- a/examples/autonat/Cargo.toml +++ b/examples/autonat/Cargo.toml @@ -11,3 +11,6 @@ clap = { version = "4.3.23", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" libp2p = { path = "../../libp2p", features = ["tokio", "tcp", "noise", "yamux", "autonat", "identify", "macros"] } + +[lints] +workspace = true diff --git a/examples/browser-webrtc/Cargo.toml b/examples/browser-webrtc/Cargo.toml index 99263dde2b3..f6b47d4ded9 100644 --- a/examples/browser-webrtc/Cargo.toml +++ b/examples/browser-webrtc/Cargo.toml @@ -21,7 +21,7 @@ rand = "0.8" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] axum = "0.6.19" -libp2p = { path = "../../libp2p", features = ["ed25519", "macros", "ping", "wasm-bindgen", "tokio"] } +libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "wasm-bindgen", "tokio"] } libp2p-webrtc = { workspace = true, features = ["tokio"] } rust-embed = { version = "8.0.0", features = ["include-exclude", "interpolate-folder-path"] } tokio = { version = "1.29", features = ["macros", "net", "rt", "signal"] } @@ -32,9 +32,12 @@ mime_guess = "2.0.4" [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3.64" -libp2p = { path = "../../libp2p", features = ["ed25519", "macros", "ping", "wasm-bindgen"] } +libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "wasm-bindgen"] } libp2p-webrtc-websys = { workspace = true } wasm-bindgen = "0.2.84" wasm-bindgen-futures = "0.4.37" wasm-logger = { version = "0.2.0" } web-sys = { version = "0.3", features = ['Document', 'Element', 'HtmlElement', 'Node', 'Response', 'Window'] } + +[lints] +workspace = true diff --git a/examples/chat/Cargo.toml b/examples/chat/Cargo.toml index 9c539c851d7..cee9e553e27 100644 --- a/examples/chat/Cargo.toml +++ b/examples/chat/Cargo.toml @@ -10,4 +10,7 @@ tokio = { version = "1.32", features = ["full"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["tokio", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] } +libp2p = { path = "../../libp2p", features = [ "tokio", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] } + +[lints] +workspace = true diff --git a/examples/dcutr/Cargo.toml b/examples/dcutr/Cargo.toml index 852083d0977..49e1ada2e96 100644 --- a/examples/dcutr/Cargo.toml +++ b/examples/dcutr/Cargo.toml @@ -10,5 +10,8 @@ clap = { version = "4.3.23", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" futures-timer = "3.0" -libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] } +libp2p = { path = "../../libp2p", features = [ "async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] } log = "0.4" + +[lints] +workspace = true diff --git a/examples/distributed-key-value-store/Cargo.toml b/examples/distributed-key-value-store/Cargo.toml index d128d6bbc51..aa9a875be5a 100644 --- a/examples/distributed-key-value-store/Cargo.toml +++ b/examples/distributed-key-value-store/Cargo.toml @@ -10,4 +10,7 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] } +libp2p = { path = "../../libp2p", features = [ "async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] } + +[lints] +workspace = true diff --git a/examples/file-sharing/Cargo.toml b/examples/file-sharing/Cargo.toml index 03745aacb00..90462790c11 100644 --- a/examples/file-sharing/Cargo.toml +++ b/examples/file-sharing/Cargo.toml @@ -12,5 +12,8 @@ clap = { version = "4.3.23", features = ["derive"] } either = "1.9" env_logger = "0.10" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "cbor", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] } +libp2p = { path = "../../libp2p", features = [ "async-std", "cbor", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] } void = "1.0.2" + +[lints] +workspace = true diff --git a/examples/identify/Cargo.toml b/examples/identify/Cargo.toml index fb14aeba4a5..cc30a0c614c 100644 --- a/examples/identify/Cargo.toml +++ b/examples/identify/Cargo.toml @@ -10,4 +10,7 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio","yamux"] } + +[lints] +workspace = true diff --git a/examples/ipfs-kad/Cargo.toml b/examples/ipfs-kad/Cargo.toml index 78021b09868..5229cb26498 100644 --- a/examples/ipfs-kad/Cargo.toml +++ b/examples/ipfs-kad/Cargo.toml @@ -10,4 +10,7 @@ tokio = { version = "1.12", features = ["rt-multi-thread", "macros"] } async-trait = "0.1" env_logger = "0.10" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["tokio", "dns", "kad", "noise", "tcp", "websocket", "yamux", "rsa"] } +libp2p = { path = "../../libp2p", features = [ "tokio", "dns", "kad", "noise", "tcp", "websocket", "yamux", "rsa"] } + +[lints] +workspace = true diff --git a/examples/ipfs-private/Cargo.toml b/examples/ipfs-private/Cargo.toml index ba8e8e12232..4bf501886db 100644 --- a/examples/ipfs-private/Cargo.toml +++ b/examples/ipfs-private/Cargo.toml @@ -11,4 +11,7 @@ async-trait = "0.1" either = "1.9" env_logger = "0.10" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["tokio", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] } +libp2p = { path = "../../libp2p", features = [ "tokio", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] } + +[lints] +workspace = true diff --git a/examples/metrics/Cargo.toml b/examples/metrics/Cargo.toml index b81c0142fd9..8cf7e1fc406 100644 --- a/examples/metrics/Cargo.toml +++ b/examples/metrics/Cargo.toml @@ -13,3 +13,6 @@ libp2p = { path = "../../libp2p", features = ["async-std", "metrics", "ping", "n log = "0.4.20" tokio = { version = "1", features = ["rt-multi-thread"] } prometheus-client = "0.21.2" + +[lints] +workspace = true diff --git a/examples/ping/Cargo.toml b/examples/ping/Cargo.toml index 985959be301..b39df505b4a 100644 --- a/examples/ping/Cargo.toml +++ b/examples/ping/Cargo.toml @@ -10,3 +10,6 @@ env_logger = "0.10.0" futures = "0.3.28" libp2p = { path = "../../libp2p", features = ["noise", "ping", "tcp", "tokio", "yamux"] } tokio = { version = "1.32.0", features = ["full"] } + +[lints] +workspace = true diff --git a/examples/relay-server/Cargo.toml b/examples/relay-server/Cargo.toml index 49c32cd3b50..39d899f5573 100644 --- a/examples/relay-server/Cargo.toml +++ b/examples/relay-server/Cargo.toml @@ -11,4 +11,7 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay", "quic"] } +libp2p = { path = "../../libp2p", features = [ "async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay", "quic"] } + +[lints] +workspace = true diff --git a/examples/rendezvous/Cargo.toml b/examples/rendezvous/Cargo.toml index a66c758e018..e98f465bc3b 100644 --- a/examples/rendezvous/Cargo.toml +++ b/examples/rendezvous/Cargo.toml @@ -10,6 +10,9 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] } +libp2p = { path = "../../libp2p", features = [ "async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] } log = "0.4" -tokio = { version = "1.32", features = [ "rt-multi-thread", "macros", "time" ] } +tokio = { version = "1.32", features = ["rt-multi-thread", "macros", "time"] } + +[lints] +workspace = true diff --git a/examples/upnp/Cargo.toml b/examples/upnp/Cargo.toml index afb8f61d2a2..74e88bf82bd 100644 --- a/examples/upnp/Cargo.toml +++ b/examples/upnp/Cargo.toml @@ -6,6 +6,9 @@ publish = false license = "MIT" [dependencies] -tokio = { version = "1", features = [ "rt-multi-thread", "macros"] } +tokio = { version = "1", features = ["rt-multi-thread", "macros"] } futures = "0.3.28" libp2p = { path = "../../libp2p", features = ["tokio", "dns", "macros", "noise", "ping", "tcp", "websocket", "yamux", "upnp"] } + +[lints] +workspace = true diff --git a/identity/Cargo.toml b/identity/Cargo.toml index 3a2556f0ed3..69f8bf55f02 100644 --- a/identity/Cargo.toml +++ b/identity/Cargo.toml @@ -19,7 +19,7 @@ hkdf = { version = "0.12.3", optional = true } libsecp256k1 = { version = "0.7.0", optional = true } log = "0.4" multihash = { version = "0.19.1", optional = true } -p256 = { version = "0.13", default-features = false, features = ["ecdsa", "std", "pem"], optional = true } +p256 = { version = "0.13", default-features = false, features = [ "ecdsa", "std", "pem"], optional = true } quick-protobuf = "0.8.1" rand = { version = "0.8", optional = true } sec1 = { version = "0.7", default-features = false, optional = true } @@ -30,14 +30,14 @@ void = { version = "1.0", optional = true } zeroize = { version = "1.6", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true} +ring = { version = "0.16.9", features = [ "alloc", "std"], default-features = false, optional = true } [features] -secp256k1 = [ "dep:libsecp256k1", "dep:asn1_der", "dep:rand", "dep:sha2", "dep:hkdf", "dep:zeroize" ] -ecdsa = [ "dep:p256", "dep:rand", "dep:void", "dep:zeroize", "dep:sec1", "dep:sha2", "dep:hkdf" ] -rsa = [ "dep:ring", "dep:asn1_der", "dep:rand", "dep:zeroize" ] -ed25519 = [ "dep:ed25519-dalek", "dep:rand", "dep:zeroize", "dep:sha2", "dep:hkdf" ] -peerid = [ "dep:multihash", "dep:bs58", "dep:rand", "dep:thiserror", "dep:sha2", "dep:hkdf" ] +secp256k1 = ["dep:libsecp256k1", "dep:asn1_der", "dep:rand", "dep:sha2", "dep:hkdf", "dep:zeroize"] +ecdsa = ["dep:p256", "dep:rand", "dep:void", "dep:zeroize", "dep:sec1", "dep:sha2", "dep:hkdf"] +rsa = ["dep:ring", "dep:asn1_der", "dep:rand", "dep:zeroize"] +ed25519 = ["dep:ed25519-dalek", "dep:rand", "dep:zeroize", "dep:sha2", "dep:hkdf"] +peerid = ["dep:multihash", "dep:bs58", "dep:rand", "dep:thiserror", "dep:sha2", "dep:hkdf" ] [dev-dependencies] quickcheck = { workspace = true } @@ -57,3 +57,6 @@ harness = false all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index 1966aee414d..ac046da69cd 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -19,11 +19,13 @@ rand = "0.8.5" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] axum = "0.6" -libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] } +libp2p = { path = "../libp2p", features = [ "ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] } libp2p-webrtc = { workspace = true, features = ["tokio"] } libp2p-mplex = { path = "../muxers/mplex" } mime_guess = "2.0" -redis = { version = "0.23.3", default-features = false, features = ["tokio-comp"] } +redis = { version = "0.23.3", default-features = false, features = [ + "tokio-comp", +] } rust-embed = "8.0" serde_json = "1" thirtyfour = "=0.32.0-rc.8" # https://github.com/stevepryde/thirtyfour/issues/169 @@ -33,7 +35,7 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -libp2p = { path = "../libp2p", features = ["ping", "macros", "webtransport-websys", "wasm-bindgen", "identify"] } +libp2p = { path = "../libp2p", features = [ "ping", "macros", "webtransport-websys", "wasm-bindgen", "identify"] } libp2p-webrtc-websys = { workspace = true } wasm-bindgen = { version = "0.2" } wasm-bindgen-futures = { version = "0.4" } @@ -42,3 +44,6 @@ instant = "0.1.12" reqwest = { version = "0.11", features = ["json"] } console_error_panic_hook = { version = "0.1.7" } futures-timer = "3.0.2" + +[lints] +workspace = true diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 6b11d7deec4..1264a050561 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -50,10 +50,10 @@ full = [ "websocket", "webtransport-websys", "yamux", - "upnp" + "upnp", ] -async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std"] +async-std = [ "libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std",] autonat = ["dep:libp2p-autonat"] cbor = ["libp2p-request-response?/cbor"] dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"] @@ -83,9 +83,9 @@ secp256k1 = ["libp2p-identity/secp256k1"] serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"] tcp = ["dep:libp2p-tcp"] tls = ["dep:libp2p-tls"] -tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio", "libp2p-upnp?/tokio"] +tokio = [ "libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio", "libp2p-upnp?/tokio"] uds = ["dep:libp2p-uds"] -wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen"] +wasm-bindgen = [ "futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen",] wasm-ext = ["dep:libp2p-wasm-ext"] wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"] websocket = ["dep:libp2p-websocket"] @@ -97,8 +97,8 @@ upnp = ["dep:libp2p-upnp"] bytes = "1" futures = "0.3.26" futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` feature -getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature -instant = "0.1.12" # Explicit dependency to be used in `wasm-bindgen` feature +getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature +instant = "0.1.12" # Explicit dependency to be used in `wasm-bindgen` feature libp2p-allow-block-list = { workspace = true } libp2p-autonat = { workspace = true, optional = true } @@ -144,7 +144,7 @@ async-trait = "0.1" either = "1.8.0" env_logger = "0.10.0" clap = { version = "4.1.6", features = ["derive"] } -tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] } +tokio = { version = "1.15", features = [ "io-util", "io-std", "macros", "rt", "rt-multi-thread"] } libp2p-noise = { workspace = true } libp2p-tcp = { workspace = true, features = ["tokio"] } @@ -155,3 +155,6 @@ libp2p-tcp = { workspace = true, features = ["tokio"] } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/misc/allow-block-list/Cargo.toml b/misc/allow-block-list/Cargo.toml index 42a6f634272..84125f0c0a7 100644 --- a/misc/allow-block-list/Cargo.toml +++ b/misc/allow-block-list/Cargo.toml @@ -19,3 +19,6 @@ void = "1" async-std = { version = "1.12.0", features = ["attributes"] } libp2p-swarm-derive = { path = "../../swarm-derive" } libp2p-swarm-test = { path = "../../swarm-test" } + +[lints] +workspace = true diff --git a/misc/connection-limits/Cargo.toml b/misc/connection-limits/Cargo.toml index 25347e29b16..1ba551470a0 100644 --- a/misc/connection-limits/Cargo.toml +++ b/misc/connection-limits/Cargo.toml @@ -23,3 +23,6 @@ libp2p-swarm-derive = { path = "../../swarm-derive" } libp2p-swarm-test = { path = "../../swarm-test" } quickcheck = { workspace = true } rand = "0.8.5" + +[lints] +workspace = true diff --git a/misc/futures-bounded/Cargo.toml b/misc/futures-bounded/Cargo.toml index fae7528ad9c..4d70779e282 100644 --- a/misc/futures-bounded/Cargo.toml +++ b/misc/futures-bounded/Cargo.toml @@ -18,3 +18,6 @@ futures-timer = "3.0.2" [dev-dependencies] tokio = { version = "1.29.1", features = ["macros", "rt"] } + +[lints] +workspace = true diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index b695915011d..da3e4a14395 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -17,3 +17,6 @@ serde_json = "1.0.107" libp2p-core = { workspace = true } base64 = "0.21.4" libp2p-identity = { workspace = true } + +[lints] +workspace = true diff --git a/misc/memory-connection-limits/Cargo.toml b/misc/memory-connection-limits/Cargo.toml index 6bfecfd2b0e..eb65d26ac66 100644 --- a/misc/memory-connection-limits/Cargo.toml +++ b/misc/memory-connection-limits/Cargo.toml @@ -24,3 +24,6 @@ libp2p-identify = { workspace = true } libp2p-swarm-derive = { path = "../../swarm-derive" } libp2p-swarm-test = { path = "../../swarm-test" } rand = "0.8.5" + +[lints] +workspace = true diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index 1ea026a9202..0cb9840955b 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -38,3 +38,6 @@ prometheus-client = { version = "0.21.2"} all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/misc/multistream-select/Cargo.toml b/misc/multistream-select/Cargo.toml index 8d19e3e5b5c..6bd072070e7 100644 --- a/misc/multistream-select/Cargo.toml +++ b/misc/multistream-select/Cargo.toml @@ -32,3 +32,6 @@ rw-stream-sink = { workspace = true } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/misc/quick-protobuf-codec/Cargo.toml b/misc/quick-protobuf-codec/Cargo.toml index 37cdd07f225..0f793d1f185 100644 --- a/misc/quick-protobuf-codec/Cargo.toml +++ b/misc/quick-protobuf-codec/Cargo.toml @@ -23,3 +23,6 @@ quick-protobuf = "0.8" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/misc/quickcheck-ext/Cargo.toml b/misc/quickcheck-ext/Cargo.toml index 0c427dc4fc9..65e45e47ab8 100644 --- a/misc/quickcheck-ext/Cargo.toml +++ b/misc/quickcheck-ext/Cargo.toml @@ -8,3 +8,6 @@ license = "Unlicense/MIT" [dependencies] quickcheck = "1" num-traits = "0.2" + +[lints] +workspace = true diff --git a/misc/rw-stream-sink/Cargo.toml b/misc/rw-stream-sink/Cargo.toml index b6d02c28201..f1537e9e7ac 100644 --- a/misc/rw-stream-sink/Cargo.toml +++ b/misc/rw-stream-sink/Cargo.toml @@ -24,3 +24,6 @@ async-std = "1.0" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/misc/server/Cargo.toml b/misc/server/Cargo.toml index aa259ce8214..e0d7af3a823 100644 --- a/misc/server/Cargo.toml +++ b/misc/server/Cargo.toml @@ -25,3 +25,6 @@ serde_derive = "1.0.125" serde_json = "1.0" tokio = { version = "1", features = ["rt-multi-thread", "macros"] } zeroize = "1" + +[lints] +workspace = true diff --git a/misc/webrtc-utils/Cargo.toml b/misc/webrtc-utils/Cargo.toml index 62df0b05638..4401ef9bc44 100644 --- a/misc/webrtc-utils/Cargo.toml +++ b/misc/webrtc-utils/Cargo.toml @@ -30,3 +30,6 @@ asynchronous-codec = "0.6" [dev-dependencies] hex-literal = "0.4" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } + +[lints] +workspace = true diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index 50a2d10571e..aca3ec6eadf 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -43,3 +43,6 @@ harness = false all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/muxers/test-harness/Cargo.toml b/muxers/test-harness/Cargo.toml index af73de33f8c..5304509b9cc 100644 --- a/muxers/test-harness/Cargo.toml +++ b/muxers/test-harness/Cargo.toml @@ -13,3 +13,6 @@ futures = "0.3.28" log = "0.4" futures-timer = "3.0.2" futures_ringbuf = "0.4.0" + +[lints] +workspace = true diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 11b94ac9738..3073c040ff3 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -27,3 +27,6 @@ libp2p-muxer-test-harness = { path = "../test-harness" } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index 4a8c9fe71d6..3b81d62b516 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -34,3 +34,6 @@ libp2p-swarm-test = { path = "../../swarm-test" } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index acade64cae8..f12684816c6 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -47,3 +47,6 @@ rand = "0.8" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 9625ada1a6b..dfa9ad63bd2 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -31,3 +31,6 @@ thiserror = "1.0.49" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index d7299bc9b7a..684cc878654 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -58,3 +58,6 @@ quickcheck = { workspace = true } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index 557f5a18736..37b94b28f6c 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -39,3 +39,6 @@ libp2p-swarm = { workspace = true, features = ["macros"] } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 3c31f3bab46..f97f4ba03ad 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -54,3 +54,6 @@ serde = ["dep:serde", "bytes/serde"] all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index c200c478321..da2c0c93241 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -55,3 +55,6 @@ required-features = ["tokio"] all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/perf/Cargo.toml b/protocols/perf/Cargo.toml index 41b91ea1209..50ca36a99e2 100644 --- a/protocols/perf/Cargo.toml +++ b/protocols/perf/Cargo.toml @@ -43,3 +43,6 @@ libp2p-swarm-test = { path = "../../swarm-test" } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 29cf5985b76..a15407b2840 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -35,3 +35,6 @@ quickcheck = { workspace = true } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index a13ba2bb229..03799a8c77c 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -43,3 +43,6 @@ quickcheck = { workspace = true } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index b231f9d7c24..c3912b78ddf 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -46,3 +46,6 @@ libp2p-swarm-test = { path = "../../swarm-test" } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 3b228fe20b3..b87048bb629 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -46,3 +46,6 @@ serde = { version = "1.0", features = ["derive"]} all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/protocols/upnp/Cargo.toml b/protocols/upnp/Cargo.toml index 4121745de42..9367f0d6317 100644 --- a/protocols/upnp/Cargo.toml +++ b/protocols/upnp/Cargo.toml @@ -22,3 +22,6 @@ tokio = { version = "1.29", default-features = false, features = ["rt"], optiona [features] tokio = ["igd-next/aio_tokio", "dep:tokio"] + +[lints] +workspace = true diff --git a/swarm-derive/Cargo.toml b/swarm-derive/Cargo.toml index 75a3ac29eee..cab9488b597 100644 --- a/swarm-derive/Cargo.toml +++ b/swarm-derive/Cargo.toml @@ -26,3 +26,6 @@ proc-macro2 = "1.0" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/swarm-test/Cargo.toml b/swarm-test/Cargo.toml index 67753b1c522..8c953b2b52f 100644 --- a/swarm-test/Cargo.toml +++ b/swarm-test/Cargo.toml @@ -23,3 +23,6 @@ futures = "0.3.28" log = "0.4.20" rand = "0.8.5" futures-timer = "3.0.2" + +[lints] +workspace = true diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index a991bacd53e..038041c536f 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -43,14 +43,14 @@ async-std = { version = "1.6.2", features = ["attributes"] } either = "1.9.0" env_logger = "0.10" futures = "0.3.28" -libp2p-identify = { path = "../protocols/identify" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-identify = { path = "../protocols/identify" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. libp2p-identity = { workspace = true, features = ["ed25519"] } -libp2p-kad = { path = "../protocols/kad" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-ping = { path = "../protocols/ping" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-plaintext = { path = "../transports/plaintext" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-swarm-derive = { path = "../swarm-derive" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-swarm-test = { path = "../swarm-test" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. -libp2p-yamux = { path = "../muxers/yamux" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-kad = { path = "../protocols/kad" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-ping = { path = "../protocols/ping" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-plaintext = { path = "../transports/plaintext" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-swarm-derive = { path = "../swarm-derive" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-swarm-test = { path = "../swarm-test" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. +libp2p-yamux = { path = "../muxers/yamux" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing. quickcheck = { workspace = true } void = "1" once_cell = "1.18.0" @@ -67,3 +67,6 @@ required-features = ["macros"] all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/deflate/Cargo.toml b/transports/deflate/Cargo.toml index 95f552f63c8..9e2e1f4e029 100644 --- a/transports/deflate/Cargo.toml +++ b/transports/deflate/Cargo.toml @@ -28,3 +28,6 @@ futures_ringbuf = "0.4.0" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index 81ee2312089..1d5fb1bc7f9 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -41,3 +41,6 @@ tokio-dns-over-https-rustls = ["tokio", "trust-dns-resolver/dns-over-https-rustl all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 8bda1cfc153..876a3cd34d5 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -43,3 +43,6 @@ quickcheck = { workspace = true } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 573114672da..f58fefb44ca 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -33,3 +33,6 @@ futures_ringbuf = "0.4.0" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/pnet/Cargo.toml b/transports/pnet/Cargo.toml index 5861bf2d987..1a3a1224fbb 100644 --- a/transports/pnet/Cargo.toml +++ b/transports/pnet/Cargo.toml @@ -20,7 +20,7 @@ pin-project = "1.1.3" [dev-dependencies] libp2p-core = { workspace = true } -libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "ecdsa", "secp256k1"] } +libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "ecdsa","secp256k1"] } libp2p-noise = { workspace = true } libp2p-swarm = { workspace = true, features = ["tokio"] } libp2p-tcp = { workspace = true, features = ["tokio"] } @@ -35,3 +35,6 @@ tokio = { version = "1.32.0", features = ["full"] } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 1907595e99e..697c257fa52 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -51,3 +51,6 @@ tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread", "time"] } [[test]] name = "stream_compliance" required-features = ["async-std"] + +[lints] +workspace = true diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index ffee29c54c6..1cb060eed54 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -38,3 +38,6 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/tls/Cargo.toml b/transports/tls/Cargo.toml index 645f2dd3a7b..b2ca28784f7 100644 --- a/transports/tls/Cargo.toml +++ b/transports/tls/Cargo.toml @@ -41,3 +41,6 @@ tokio = { version = "1.32.0", features = ["full"] } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index d776ac3366d..1bc78ff35a9 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -26,3 +26,6 @@ tempfile = "3.8" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index d7deba525e0..6d5ed8e229c 100644 --- a/transports/wasm-ext/Cargo.toml +++ b/transports/wasm-ext/Cargo.toml @@ -27,3 +27,6 @@ websocket = [] all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/webrtc-websys/Cargo.toml b/transports/webrtc-websys/Cargo.toml index 19148068fce..cb90573b1fe 100644 --- a/transports/webrtc-websys/Cargo.toml +++ b/transports/webrtc-websys/Cargo.toml @@ -34,3 +34,6 @@ web-sys = { version = "0.3.64", features = ["Document", "Location", "MessageEven hex-literal = "0.4" libp2p-ping = { workspace = true } libp2p-swarm = { workspace = true, features = ["wasm-bindgen"] } + +[lints] +workspace = true diff --git a/transports/webrtc/Cargo.toml b/transports/webrtc/Cargo.toml index 7cd16f2ceb2..8a8c928a775 100644 --- a/transports/webrtc/Cargo.toml +++ b/transports/webrtc/Cargo.toml @@ -29,7 +29,7 @@ serde = { version = "1.0", features = ["derive"] } stun = "0.5" thiserror = "1" tinytemplate = "1.2" -tokio = { version = "1.32", features = ["net"], optional = true} +tokio = { version = "1.32", features = ["net"], optional = true } tokio-util = { version = "0.7", features = ["compat"], optional = true } webrtc = { version = "0.9.0", optional = true } @@ -45,3 +45,6 @@ quickcheck = "1.0.3" [[test]] name = "smoke" required-features = ["tokio"] + +[lints] +workspace = true diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index f3ebf5af000..62a5129cbfa 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -36,3 +36,6 @@ rcgen = "0.10.0" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/transports/webtransport-websys/Cargo.toml b/transports/webtransport-websys/Cargo.toml index 9f59339a622..54ecc5b9b40 100644 --- a/transports/webtransport-websys/Cargo.toml +++ b/transports/webtransport-websys/Cargo.toml @@ -46,3 +46,6 @@ multibase = "0.9.1" all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/wasm-tests/webtransport-tests/Cargo.toml b/wasm-tests/webtransport-tests/Cargo.toml index 6c564281274..8d3f756ecb7 100644 --- a/wasm-tests/webtransport-tests/Cargo.toml +++ b/wasm-tests/webtransport-tests/Cargo.toml @@ -18,3 +18,6 @@ wasm-bindgen = "0.2.87" wasm-bindgen-futures = "0.4.37" wasm-bindgen-test = "0.3.37" web-sys = { version = "0.3.64", features = ["Response", "Window"] } + +[lints] +workspace = true