diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..5795ff1 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,14 @@ +imports_granularity = "Item" +group_imports = "StdExternalCrate" + +# In rustfmt 2.0 I will want to adjust these settings. +# +# max_width controls the max length of a line before rustfmt gives up +# but that also scales the length of a bunch of other lines +# automaticaly due to width_heuristics. I want to find a way to enable +# rustfmt to work on longer lines when necessary without making my +# regular code too wide. +# +# max_width = 100 +# error_on_line_overflow = true +# width_heuristics = "Off" diff --git a/src/discovery.rs b/src/discovery.rs index 407f320..824f332 100644 --- a/src/discovery.rs +++ b/src/discovery.rs @@ -1,12 +1,13 @@ use std::path::Path; use std::path::PathBuf; +use regex::Regex; +use tracing::debug; + use crate::crd_pipeline_run::PipelineRun; use crate::gitea_client::GiteaClient; use crate::gitea_client::Tree; use crate::remote_config::RemoteConfig; -use regex::Regex; -use tracing::debug; pub(crate) async fn discover_webhook_bridge_config( gitea: &GiteaClient, diff --git a/src/gitea_client/mod.rs b/src/gitea_client/mod.rs index e4ee87f..7548a73 100644 --- a/src/gitea_client/mod.rs +++ b/src/gitea_client/mod.rs @@ -1,4 +1,5 @@ -use base64::{engine::general_purpose, Engine as _}; +use base64::engine::general_purpose; +use base64::Engine as _; use serde::Deserialize; use tracing::debug; diff --git a/src/webhook.rs b/src/webhook.rs index 26ea141..ce39ae4 100644 --- a/src/webhook.rs +++ b/src/webhook.rs @@ -13,7 +13,8 @@ use axum::response::IntoResponse; use axum::response::Response; use axum::Json; use axum::RequestExt; -use base64::{engine::general_purpose, Engine as _}; +use base64::engine::general_purpose; +use base64::Engine as _; use hmac::Hmac; use hmac::Mac; use http_body_util::BodyExt;