diff --git a/clippy.toml b/clippy.toml index 08641fcc..b93b2377 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 e20fa8c2..a0133704 100644 --- a/src/api/client/report.rs +++ b/src/api/client/report.rs @@ -2,7 +2,7 @@ use std::time::Duration; 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 @@ use ruma::{ 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 c3524f0e..af570064 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 @@ use ruma::{ 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 85574a2f..f7420784 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 1c415c6a..48b7f0f3 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 6c396921..af8bd70b 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 08263353..144bff85 100644 --- a/src/router/serve/plain.rs +++ b/src/router/serve/plain.rs @@ -5,9 +5,8 @@ use std::{ 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, app: Router, handle: ServerHandle, addrs: Vec,