diff --git a/clippy.toml b/clippy.toml index 08641fcc15205bd903bd63037416ada9505e58f4..b93b2377505f52ab2833c601013b6bb789c4bfce 100644 --- a/clippy.toml +++ b/clippy.toml @@ -5,3 +5,11 @@ future-size-threshold = 7745 # TODO reduce me ALARA stack-size-threshold = 196608 # reduce me ALARA too-many-lines-threshold = 700 # TODO reduce me to <= 100 type-complexity-threshold = 250 # reduce me to ~200 + +disallowed-macros = [ + { path = "log::error", reason = "use conduit_core::error" }, + { path = "log::warn", reason = "use conduit_core::warn" }, + { path = "log::info", reason = "use conduit_core::info" }, + { path = "log::debug", reason = "use conduit_core::debug" }, + { path = "log::trace", reason = "use conduit_core::trace" }, +] diff --git a/src/api/client/report.rs b/src/api/client/report.rs index e20fa8c222bfea383a0cae6783936d38b8b0972e..a013370450579e887f04ade6e2cdc9273770ebd7 100644 --- a/src/api/client/report.rs +++ b/src/api/client/report.rs @@ -2,7 +2,7 @@ use axum::extract::State; use axum_client_ip::InsecureClientIp; -use conduit::{utils::ReadyExt, Err}; +use conduit::{info, utils::ReadyExt, Err}; use rand::Rng; use ruma::{ api::client::{ @@ -13,7 +13,6 @@ int, EventId, RoomId, UserId, }; use tokio::time::sleep; -use tracing::info; use crate::{ debug_info, diff --git a/src/api/server/make_join.rs b/src/api/server/make_join.rs index c3524f0e44b4d2fd570696714e4dc859b4372b25..af570064726e6c8cd3599cc633ccd6c98e233d2f 100644 --- a/src/api/server/make_join.rs +++ b/src/api/server/make_join.rs @@ -1,5 +1,8 @@ use axum::extract::State; -use conduit::utils::{IterStream, ReadyExt}; +use conduit::{ + utils::{IterStream, ReadyExt}, + warn, +}; use futures::StreamExt; use ruma::{ api::{client::error::ErrorKind, federation::membership::prepare_join_event}, @@ -13,7 +16,6 @@ CanonicalJsonObject, RoomId, RoomVersionId, UserId, }; use serde_json::value::to_raw_value; -use tracing::warn; use crate::{ service::{pdu::PduBuilder, Services}, diff --git a/src/core/debug.rs b/src/core/debug.rs index 85574a2f3d54929815a0d1ad5a5044910bd1456a..f7420784e56d3ca23c982eefcd8e988f6c4d343f 100644 --- a/src/core/debug.rs +++ b/src/core/debug.rs @@ -1,3 +1,5 @@ +#![allow(clippy::disallowed_macros)] + use std::{any::Any, panic}; // Export debug proc_macros diff --git a/src/core/log/mod.rs b/src/core/log/mod.rs index 1c415c6a0fe273584cca492dc2ca6d5c65d2e15e..48b7f0f389640a91c63ddde3756f534fc68ace8c 100644 --- a/src/core/log/mod.rs +++ b/src/core/log/mod.rs @@ -1,3 +1,5 @@ +#![allow(clippy::disallowed_macros)] + pub mod capture; pub mod color; pub mod fmt; diff --git a/src/core/utils/sys.rs b/src/core/utils/sys.rs index 6c396921ce116a1d5acd193eb22998282e9c2d3b..af8bd70b736cc50614acd0807299990f2347a4a2 100644 --- a/src/core/utils/sys.rs +++ b/src/core/utils/sys.rs @@ -1,6 +1,4 @@ -use tracing::debug; - -use crate::Result; +use crate::{debug, Result}; /// This is needed for opening lots of file descriptors, which tends to /// happen more often when using RocksDB and making lots of federation diff --git a/src/router/serve/plain.rs b/src/router/serve/plain.rs index 08263353bf0adb36cc16a0abe24b3934f6980284..144bff85da0bab6a50196a8882af106ba2329faf 100644 --- a/src/router/serve/plain.rs +++ b/src/router/serve/plain.rs @@ -5,9 +5,8 @@ use axum::Router; use axum_server::{bind, Handle as ServerHandle}; -use conduit::{debug_info, Result, Server}; +use conduit::{debug_info, info, Result, Server}; use tokio::task::JoinSet; -use tracing::info; pub(super) async fn serve( server: &Arc<Server>, app: Router, handle: ServerHandle, addrs: Vec<SocketAddr>,