diff --git a/buildpacks/ruby/src/gem_list.rs b/buildpacks/ruby/src/gem_list.rs index c4754c7a..50a41be0 100644 --- a/buildpacks/ruby/src/gem_list.rs +++ b/buildpacks/ruby/src/gem_list.rs @@ -1,8 +1,9 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{fmt, section_log::*}; - use commons::fun_run::{CmdError, CommandWithName}; use commons::gem_version::GemVersion; +use commons::output::{ + fmt, + section_log::{log_step_timed, SectionLogger}, +}; use core::str::FromStr; use regex::Regex; use std::collections::HashMap; diff --git a/buildpacks/ruby/src/layers/bundle_download_layer.rs b/buildpacks/ruby/src/layers/bundle_download_layer.rs index 642c9315..12867a8d 100644 --- a/buildpacks/ruby/src/layers/bundle_download_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_download_layer.rs @@ -1,5 +1,7 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{fmt, section_log::*}; +use commons::output::{ + fmt, + section_log::{log_step, log_step_timed, SectionLogger}, +}; use crate::RubyBuildpack; use crate::RubyBuildpackError; diff --git a/buildpacks/ruby/src/layers/bundle_install_layer.rs b/buildpacks/ruby/src/layers/bundle_install_layer.rs index 90508ff9..cad034f7 100644 --- a/buildpacks/ruby/src/layers/bundle_install_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_install_layer.rs @@ -1,7 +1,6 @@ -#[allow(clippy::wildcard_imports)] use commons::output::{ fmt::{self, HELP}, - section_log::*, + section_log::{log_step, log_step_stream, SectionLogger}, }; use crate::{BundleWithout, RubyBuildpack, RubyBuildpackError}; diff --git a/buildpacks/ruby/src/layers/ruby_install_layer.rs b/buildpacks/ruby/src/layers/ruby_install_layer.rs index 833224c2..d34ac6d1 100644 --- a/buildpacks/ruby/src/layers/ruby_install_layer.rs +++ b/buildpacks/ruby/src/layers/ruby_install_layer.rs @@ -1,7 +1,6 @@ -#[allow(clippy::wildcard_imports)] use commons::output::{ fmt::{self}, - section_log::*, + section_log::{log_step, log_step_timed, SectionLogger}, }; use crate::{RubyBuildpack, RubyBuildpackError}; diff --git a/buildpacks/ruby/src/main.rs b/buildpacks/ruby/src/main.rs index fecc58b4..9148f348 100644 --- a/buildpacks/ruby/src/main.rs +++ b/buildpacks/ruby/src/main.rs @@ -6,6 +6,8 @@ use commons::fun_run::CmdError; use commons::gemfile_lock::GemfileLock; use commons::metadata_digest::MetadataDigest; use commons::output::warn_later::WarnGuard; +#[allow(clippy::wildcard_imports)] +use commons::output::{build_log::*, fmt}; use core::str::FromStr; use layers::{ bundle_download_layer::{BundleDownloadLayer, BundleDownloadLayerMetadata}, @@ -24,9 +26,6 @@ use libcnb::Platform; use libcnb::{buildpack_main, Buildpack}; use std::io::stdout; -#[allow(clippy::wildcard_imports)] -use commons::output::{build_log::*, fmt}; - mod gem_list; mod layers; mod rake_status; diff --git a/buildpacks/ruby/src/rake_task_detect.rs b/buildpacks/ruby/src/rake_task_detect.rs index e103a4a9..1782bc58 100644 --- a/buildpacks/ruby/src/rake_task_detect.rs +++ b/buildpacks/ruby/src/rake_task_detect.rs @@ -1,5 +1,7 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{fmt, section_log::*}; +use commons::output::{ + fmt, + section_log::{log_step_timed, SectionLogger}, +}; use commons::fun_run::{CmdError, CommandWithName}; use core::str::FromStr; diff --git a/buildpacks/ruby/src/steps/detect_rake_tasks.rs b/buildpacks/ruby/src/steps/detect_rake_tasks.rs index b7758814..97126225 100644 --- a/buildpacks/ruby/src/steps/detect_rake_tasks.rs +++ b/buildpacks/ruby/src/steps/detect_rake_tasks.rs @@ -1,7 +1,6 @@ -#[allow(clippy::wildcard_imports)] use commons::output::{ fmt::{self, HELP}, - section_log::*, + section_log::{log_step, SectionLogger}, }; use crate::gem_list::GemList; diff --git a/buildpacks/ruby/src/steps/get_default_process.rs b/buildpacks/ruby/src/steps/get_default_process.rs index aad981d1..8683411c 100644 --- a/buildpacks/ruby/src/steps/get_default_process.rs +++ b/buildpacks/ruby/src/steps/get_default_process.rs @@ -1,8 +1,9 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{fmt, section_log::*}; - use crate::gem_list::GemList; use crate::RubyBuildpack; +use commons::output::{ + fmt, + section_log::{log_step, SectionLogger}, +}; use libcnb::build::BuildContext; use libcnb::data::launch::Process; use libcnb::data::launch::ProcessBuilder; diff --git a/buildpacks/ruby/src/steps/rake_assets_install.rs b/buildpacks/ruby/src/steps/rake_assets_install.rs index 944d1b86..cd3c38de 100644 --- a/buildpacks/ruby/src/steps/rake_assets_install.rs +++ b/buildpacks/ruby/src/steps/rake_assets_install.rs @@ -1,11 +1,12 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{fmt, section_log::*}; - use crate::rake_task_detect::RakeDetect; use crate::RubyBuildpack; use crate::RubyBuildpackError; use commons::cache::{mib, AppCacheCollection, CacheConfig, KeepPath}; use commons::fun_run::{self, CmdError, CommandWithName}; +use commons::output::{ + fmt, + section_log::{log_step, log_step_stream, SectionLogger}, +}; use libcnb::build::BuildContext; use libcnb::Env; use std::process::Command; diff --git a/commons/bin/print_style_guide.rs b/commons/bin/print_style_guide.rs index 52a41668..53ccdecc 100644 --- a/commons/bin/print_style_guide.rs +++ b/commons/bin/print_style_guide.rs @@ -1,9 +1,10 @@ -#[allow(clippy::wildcard_imports)] -use commons::output::{build_log::*, section_log::*}; - use ascii_table::AsciiTable; use commons::fun_run::CommandWithName; use commons::output::fmt::{self, DEBUG_INFO, HELP}; +use commons::output::{ + build_log::*, + section_log::{log_step, log_step_stream, log_step_timed}, +}; use indoc::formatdoc; use std::io::stdout; use std::process::Command; diff --git a/commons/src/output/build_log.rs b/commons/src/output/build_log.rs index 5068c456..715beb62 100644 --- a/commons/src/output/build_log.rs +++ b/commons/src/output/build_log.rs @@ -1,14 +1,13 @@ use crate::output::background_timer::{start_timer, StopJoinGuard, StopTimer}; use crate::output::fmt; +#[allow(clippy::wildcard_imports)] +pub use crate::output::interface::*; use std::fmt::Debug; use std::io::Write; use std::marker::PhantomData; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; -#[allow(clippy::wildcard_imports)] -pub use crate::output::interface::*; - /// # Build output logging /// /// Use the `BuildLog` to output structured text as a buildpack is executing diff --git a/commons/src/output/section_log.rs b/commons/src/output/section_log.rs index ab3077f8..a89fcf77 100644 --- a/commons/src/output/section_log.rs +++ b/commons/src/output/section_log.rs @@ -24,7 +24,7 @@ use std::marker::PhantomData; /// The main use case is logging inside of a layer: /// /// ```no_run -/// use commons::output::section_log::*; +/// use commons::output::section_log::log_step_timed; /// /// // fn create( /// // &self, @@ -44,7 +44,7 @@ use std::marker::PhantomData; /// Output a message as a single step, ideally a short message /// /// ``` -/// use commons::output::section_log::*; +/// use commons::output::section_log::log_step; /// /// log_step("Clearing cache (ruby version changed)"); /// ``` @@ -56,7 +56,7 @@ pub fn log_step(s: impl AsRef) { /// that will emit to the UI until the passed in function ends /// /// ``` -/// use commons::output::section_log::*; +/// use commons::output::section_log::log_step_timed; /// /// log_step_timed("Installing", || { /// // Install logic here @@ -76,7 +76,7 @@ pub fn log_step_timed(s: impl AsRef, f: impl FnOnce() -> T) -> T { /// /// ```no_run /// use commons::fun_run::CommandWithName; -/// use commons::output::section_log::*; +/// use commons::output::section_log::log_step_stream; /// use commons::output::fmt; /// /// let mut cmd = std::process::Command::new("bundle"); diff --git a/commons/src/output/warn_later.rs b/commons/src/output/warn_later.rs index 48bc816b..b95b2be5 100644 --- a/commons/src/output/warn_later.rs +++ b/commons/src/output/warn_later.rs @@ -50,7 +50,7 @@ thread_local!(static WARN_LATER: RefCell>> = RefCell::new(Non /// /// ## Use - Issue a delayed warning /// -/// Once a warn guard is in place you can queue a warning using `section_log::*` or `build_log::*`: +/// Once a warn guard is in place you can queue a warning using `section_log::log_warning_later` or `build_log::*`: /// /// ``` /// use commons::output::warn_later::WarnGuard; @@ -67,7 +67,7 @@ thread_local!(static WARN_LATER: RefCell>> = RefCell::new(Non /// /// ``` /// use commons::output::warn_later::WarnGuard; -/// use commons::output::section_log::*; +/// use commons::output::section_log::log_warning_later; /// /// // src/main.rs /// let warn_later = WarnGuard::new(std::io::stdout());