Skip to content

Commit

Permalink
chore: Use lint config in manifest (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Jan 2, 2025
1 parent 9691256 commit 5e9a5bc
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 44 deletions.
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ members = [
"tests/skip_debug",
]
resolver = "2"

[workspace.lints.rust]
missing_debug_implementations = "warn"
missing_docs = "warn"
rust_2018_idioms = "warn"
unreachable_pub = "warn"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
3 changes: 3 additions & 0 deletions tonic-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ prost = ["prost-build", "dep:prost-types"]
cleanup-markdown = ["prost-build?/cleanup-markdown"]
transport = []

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true

Expand Down
7 changes: 0 additions & 7 deletions tonic-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@
//! fails with `No such file or directory` error.
#![recursion_limit = "256"]
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-build/0.13.0")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
Expand Down
3 changes: 3 additions & 0 deletions tonic-health/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ tokio = {version = "1.0", features = ["rt-multi-thread", "macros"]}
tokio-stream = "0.1"
prost-types = "0.13.0"

[lints]
workspace = true

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"tonic::*",
Expand Down
7 changes: 0 additions & 7 deletions tonic-health/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
//!
//! [here]: https://github.com/hyperium/tonic/blob/master/examples/src/health/server.rs
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-health/0.13.0")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
Expand Down
3 changes: 3 additions & 0 deletions tonic-reflection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ tonic = { version = "0.13.0", path = "../tonic", default-features = false, featu
[dev-dependencies]
tonic = { version = "0.13.0", path = "../tonic", default-features = false, features = ["transport"] }

[lints]
workspace = true

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"tonic::*",
Expand Down
7 changes: 0 additions & 7 deletions tonic-reflection/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
//! A `tonic` based gRPC Server Reflection implementation.
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(
html_logo_url = "https://github.com/hyperium/tonic/raw/master/.github/assets/tonic-docs.png"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-reflection/0.13.0")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
Expand Down
2 changes: 2 additions & 0 deletions tonic-reflection/tests/server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use prost::Message;
use std::net::SocketAddr;
use tokio::sync::oneshot;
Expand Down
2 changes: 2 additions & 0 deletions tonic-reflection/tests/versions.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use std::net::SocketAddr;

use tokio::sync::oneshot;
Expand Down
3 changes: 3 additions & 0 deletions tonic-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ prost = "0.13"
prost-types = "0.13"
tonic = { version = "0.13.0", path = "../tonic", default-features = false }

[lints]
workspace = true

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"tonic::*",
Expand Down
7 changes: 0 additions & 7 deletions tonic-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,9 @@
//! [error_details.proto]: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
//! [Richer Error example]: https://github.com/hyperium/tonic/tree/master/examples/src/richer-error
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-types/0.13.0")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]

Expand Down
3 changes: 3 additions & 0 deletions tonic-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ tracing = "0.1"
tokio = { version = "1", features = ["macros", "rt"] }
tower-http = { version = "0.6", features = ["cors"] }

[lints]
workspace = true

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"tonic::*",
Expand Down
2 changes: 1 addition & 1 deletion tonic-web/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
}
}

/// Response future for the [`GrpcWebService`].
/// Response future for the [`GrpcWebService`](crate::GrpcWebService).
#[pin_project]
#[must_use = "futures do nothing unless polled"]
pub struct ResponseFuture<F> {
Expand Down
6 changes: 0 additions & 6 deletions tonic-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
//! [`tonic_web`]: https://github.com/hyperium/tonic
//! [grpc-web]: https://github.com/grpc/grpc-web
//! [tower]: https://github.com/tower-rs/tower
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(html_root_url = "https://docs.rs/tonic-web/0.13.0")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]

Expand Down
3 changes: 3 additions & 0 deletions tonic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ static_assertions = "1.0"
tokio = {version = "1.0", features = ["rt", "macros"]}
tower = {version = "0.5", features = ["full"]}

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
6 changes: 4 additions & 2 deletions tonic/benches/decode.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use bencher::{benchmark_group, benchmark_main, Bencher};
use bytes::{Buf, BufMut, Bytes, BytesMut};
use http_body::{Body, Frame, SizeHint};
Expand Down Expand Up @@ -45,11 +47,11 @@ struct MockBody {
}

impl MockBody {
pub fn new(data: Bytes, chunk_size: usize) -> Self {
fn new(data: Bytes, chunk_size: usize) -> Self {
MockBody { data, chunk_size }
}

pub fn len(&self) -> usize {
fn len(&self) -> usize {
self.data.len()
}
}
Expand Down
7 changes: 0 additions & 7 deletions tonic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@
//! [`zstd`]: https://docs.rs/zstd
#![recursion_limit = "256"]
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
Expand Down

0 comments on commit 5e9a5bc

Please sign in to comment.