chore: Format files

This commit is contained in:
Gerald Pinder 2025-04-29 00:50:28 -04:00
parent 2f6b2b4b70
commit 44cecab3f4
42 changed files with 130 additions and 108 deletions

View file

@ -14,13 +14,13 @@ use std::{
time::Duration,
};
use bon::{bon, Builder};
use bon::{Builder, bon};
use cached::proc_macro::cached;
use clap::Args;
use colored::Colorize;
use indicatif::{ProgressBar, ProgressStyle};
use log::{info, trace, warn};
use miette::{miette, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, miette};
use oci_distribution::Reference;
use opts::{
BuildOpts, BuildTagPushOpts, CheckKeyPairOpts, CreateContainerOpts, GenerateImageNameOpts,

View file

@ -4,14 +4,14 @@ use blue_build_utils::{credentials::Credentials, semver::Version};
use colored::Colorize;
use comlexr::cmd;
use log::{debug, error, info, trace};
use miette::{bail, miette, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail, miette};
use serde::Deserialize;
use crate::{drivers::types::Platform, logging::CommandLogging};
use super::{
opts::{BuildOpts, PushOpts, TagOpts},
BuildDriver, DriverVersion,
opts::{BuildOpts, PushOpts, TagOpts},
};
#[derive(Debug, Deserialize)]

View file

@ -7,14 +7,14 @@ use blue_build_utils::{
use colored::Colorize;
use comlexr::{cmd, pipe};
use log::{debug, trace};
use miette::{bail, Context, IntoDiagnostic, Result};
use miette::{Context, IntoDiagnostic, Result, bail};
use crate::drivers::opts::VerifyType;
use super::{
SigningDriver,
functions::get_private_key,
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
SigningDriver,
};
#[derive(Debug)]
@ -195,8 +195,8 @@ mod test {
use tempfile::TempDir;
use crate::drivers::{
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
SigningDriver,
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
};
use super::CosignDriver;

View file

@ -15,7 +15,7 @@ use cached::proc_macro::cached;
use colored::Colorize;
use comlexr::{cmd, pipe};
use log::{debug, info, trace, warn};
use miette::{bail, Context, IntoDiagnostic, Result};
use miette::{Context, IntoDiagnostic, Result, bail};
use oci_distribution::Reference;
use serde::Deserialize;
use tempfile::TempDir;
@ -32,7 +32,7 @@ use crate::{
types::{ContainerId, ImageMetadata, Platform},
},
logging::CommandLogging,
signal_handler::{add_cid, remove_cid, ContainerRuntime, ContainerSignalId},
signal_handler::{ContainerRuntime, ContainerSignalId, add_cid, remove_cid},
};
use super::opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts};

View file

@ -1,6 +1,6 @@
use std::collections::HashMap;
use miette::{bail, Report};
use miette::{Report, bail};
use serde::Deserialize;
use crate::drivers::types::{ImageMetadata, Platform};

View file

@ -1,10 +1,10 @@
use std::{env, path::Path};
use blue_build_utils::{
constants::{BB_PRIVATE_KEY, COSIGN_PRIVATE_KEY, COSIGN_PRIV_PATH, COSIGN_PUB_PATH},
constants::{BB_PRIVATE_KEY, COSIGN_PRIV_PATH, COSIGN_PRIVATE_KEY, COSIGN_PUB_PATH},
string,
};
use miette::{bail, Result};
use miette::{Result, bail};
use super::opts::PrivateKey;

View file

@ -16,7 +16,7 @@ use blue_build_utils::get_env_var;
#[cfg(test)]
use blue_build_utils::test_utils::get_env_var;
use super::{opts::GenerateTagsOpts, CiDriver, Driver};
use super::{CiDriver, Driver, opts::GenerateTagsOpts};
mod event;
@ -153,7 +153,7 @@ mod test {
use rstest::rstest;
use crate::{
drivers::{opts::GenerateTagsOpts, types::Platform, CiDriver},
drivers::{CiDriver, opts::GenerateTagsOpts, types::Platform},
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
};

View file

@ -18,7 +18,7 @@ use blue_build_utils::test_utils::get_env_var;
use crate::drivers::Driver;
use super::{opts::GenerateTagsOpts, CiDriver};
use super::{CiDriver, opts::GenerateTagsOpts};
pub struct GitlabDriver;
@ -165,7 +165,7 @@ mod test {
use rstest::rstest;
use crate::{
drivers::{opts::GenerateTagsOpts, CiDriver},
drivers::{CiDriver, opts::GenerateTagsOpts},
test::{TEST_TAG_1, TEST_TAG_2, TIMESTAMP},
};

View file

@ -4,7 +4,7 @@ use blue_build_utils::string_vec;
use comlexr::cmd;
use log::trace;
use super::{opts::GenerateTagsOpts, CiDriver, Driver};
use super::{CiDriver, Driver, opts::GenerateTagsOpts};
pub struct LocalDriver;

View file

@ -14,27 +14,27 @@ use colored::Colorize;
use comlexr::{cmd, pipe};
use indicatif::{ProgressBar, ProgressStyle};
use log::{debug, error, info, trace};
use miette::{bail, miette, IntoDiagnostic, Report, Result};
use miette::{IntoDiagnostic, Report, Result, bail, miette};
use oci_distribution::Reference;
use serde::Deserialize;
use tempfile::TempDir;
use crate::{
drivers::{
BuildDriver, DriverVersion, InspectDriver, RunDriver,
opts::{BuildOpts, GetMetadataOpts, PushOpts, RunOpts, RunOptsEnv, RunOptsVolume, TagOpts},
types::{ImageMetadata, Platform},
BuildDriver, DriverVersion, InspectDriver, RunDriver,
},
logging::{CommandLogging, Logger},
signal_handler::{add_cid, remove_cid, ContainerRuntime, ContainerSignalId},
signal_handler::{ContainerRuntime, ContainerSignalId, add_cid, remove_cid},
};
#[cfg(feature = "rechunk")]
use super::{ContainerMountDriver, RechunkDriver, types::MountId};
use super::{
opts::{CreateContainerOpts, RemoveContainerOpts, RemoveImageOpts},
types::ContainerId,
};
#[cfg(feature = "rechunk")]
use super::{types::MountId, ContainerMountDriver, RechunkDriver};
const SUDO_PROMPT: &str = "Password for %u required to run 'podman' as privileged";

View file

@ -1,14 +1,14 @@
use std::{fs, path::Path};
use crate::{
drivers::opts::{PrivateKeyContents, VerifyType},
ASYNC_RUNTIME,
drivers::opts::{PrivateKeyContents, VerifyType},
};
use super::{
SigningDriver,
functions::get_private_key,
opts::{CheckKeyPairOpts, GenerateKeyPairOpts, SignOpts, VerifyOpts},
SigningDriver,
};
use blue_build_utils::{
constants::{COSIGN_PRIV_PATH, COSIGN_PUB_PATH},
@ -17,14 +17,14 @@ use blue_build_utils::{
};
use colored::Colorize;
use log::{debug, trace};
use miette::{bail, miette, Context, IntoDiagnostic};
use miette::{Context, IntoDiagnostic, bail, miette};
use sigstore::{
cosign::{
ClientBuilder, Constraint, CosignCapabilities, SignatureLayer,
constraint::PrivateKeySigner,
verification_constraint::{PublicKeyVerifier, VerificationConstraintVec},
ClientBuilder, Constraint, CosignCapabilities, SignatureLayer,
},
crypto::{signing_key::SigStoreKeyPair, SigningScheme},
crypto::{SigningScheme, signing_key::SigStoreKeyPair},
errors::SigstoreVerifyConstraintsError,
registry::{Auth, OciReference},
};
@ -167,8 +167,8 @@ impl SigningDriver for SigstoreDriver {
.into_diagnostic()
.with_context(|| {
format!(
"Failed to push signature {cosign_signature_image} for image {image_digest}"
)
"Failed to push signature {cosign_signature_image} for image {image_digest}"
)
})
})?;
debug!("Successfully pushed signature");
@ -242,9 +242,9 @@ mod test {
use tempfile::TempDir;
use crate::drivers::{
SigningDriver,
cosign_driver::CosignDriver,
opts::{CheckKeyPairOpts, GenerateKeyPairOpts},
SigningDriver,
};
use super::SigstoreDriver;

View file

@ -5,11 +5,11 @@ use colored::Colorize;
use comlexr::cmd;
use indicatif::{ProgressBar, ProgressStyle};
use log::{debug, trace};
use miette::{bail, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail};
use crate::{drivers::types::Platform, logging::Logger};
use super::{opts::GetMetadataOpts, types::ImageMetadata, InspectDriver};
use super::{InspectDriver, opts::GetMetadataOpts, types::ImageMetadata};
#[derive(Debug)]
pub struct SkopeoDriver;

View file

@ -6,11 +6,11 @@ use std::{
use blue_build_utils::{constants::COSIGN_PUB_PATH, retry, semver::Version, string_vec};
use log::{debug, info, trace};
use miette::{bail, Context, IntoDiagnostic, Result};
use miette::{Context, IntoDiagnostic, Result, bail};
use oci_distribution::Reference;
use semver::VersionReq;
use crate::drivers::{functions::get_private_key, types::CiDriverType, Driver};
use crate::drivers::{Driver, functions::get_private_key, types::CiDriverType};
#[cfg(feature = "sigstore")]
use super::sigstore_driver::SigstoreDriver;

View file

@ -10,8 +10,8 @@ use serde::Deserialize;
use serde_json::Value;
use crate::drivers::{
buildah_driver::BuildahDriver, docker_driver::DockerDriver, podman_driver::PodmanDriver,
DriverVersion,
DriverVersion, buildah_driver::BuildahDriver, docker_driver::DockerDriver,
podman_driver::PodmanDriver,
};
pub(super) trait DetermineDriver<T> {

View file

@ -12,23 +12,23 @@ use std::{
use bon::Builder;
use chrono::Local;
use colored::{control::ShouldColorize, ColoredString, Colorize};
use colored::{ColoredString, Colorize, control::ShouldColorize};
use indicatif::{MultiProgress, ProgressBar};
use indicatif_log_bridge::LogWrapper;
use log::{warn, Level, LevelFilter, Record};
use log::{Level, LevelFilter, Record, warn};
use log4rs::{
Config, Logger as L4RSLogger,
append::{
console::ConsoleAppender,
rolling_file::{
policy::compound::{
roll::fixed_window::FixedWindowRoller, trigger::size::SizeTrigger, CompoundPolicy,
},
RollingFileAppender,
policy::compound::{
CompoundPolicy, roll::fixed_window::FixedWindowRoller, trigger::size::SizeTrigger,
},
},
},
config::{Appender, Root},
encode::{pattern::PatternEncoder, Encode, Write},
Config, Logger as L4RSLogger,
encode::{Encode, Write, pattern::PatternEncoder},
};
use nu_ansi_term::Color;
use private::Private;

View file

@ -2,7 +2,7 @@ use std::{
fs,
path::PathBuf,
process,
sync::{atomic::AtomicBool, Arc, Mutex},
sync::{Arc, Mutex, atomic::AtomicBool},
thread,
};
@ -11,13 +11,13 @@ use comlexr::cmd;
use log::{debug, error, trace, warn};
use nix::{
libc::{SIGABRT, SIGCONT, SIGHUP, SIGTSTP},
sys::signal::{kill, Signal},
sys::signal::{Signal, kill},
unistd::Pid,
};
use signal_hook::{
consts::TERM_SIGNALS,
flag,
iterator::{exfiltrator::WithOrigin, SignalsInfo},
iterator::{SignalsInfo, exfiltrator::WithOrigin},
low_level,
};

View file

@ -36,7 +36,9 @@ pub(crate) fn base_recipe_path() -> &'static Path {
if recipe_path.exists() && recipe_path.is_dir() {
recipe_path
} else {
warn!("Use of {CONFIG_PATH} for recipes is deprecated, please move your recipe files into {RECIPE_PATH}");
warn!(
"Use of {CONFIG_PATH} for recipes is deprecated, please move your recipe files into {RECIPE_PATH}"
);
legacy_path
}
}

View file

@ -1,5 +1,5 @@
use blue_build_utils::semver::Version;
use serde::{de::Error, Deserialize, Serialize};
use serde::{Deserialize, Serialize, de::Error};
#[derive(Default, Clone, Debug)]
pub enum MaybeVersion {

View file

@ -7,11 +7,11 @@ use bon::Builder;
use colored::Colorize;
use indexmap::IndexMap;
use log::trace;
use miette::{bail, Result};
use miette::{Result, bail};
use serde::{Deserialize, Serialize};
use serde_yaml::Value;
use crate::{base_recipe_path, AkmodsInfo, ModuleExt};
use crate::{AkmodsInfo, ModuleExt, base_recipe_path};
mod type_ver;

View file

@ -9,7 +9,7 @@ use log::trace;
use miette::{Context, IntoDiagnostic, Report, Result};
use serde::{Deserialize, Serialize};
use crate::{base_recipe_path, AkmodsInfo, FromFileList, Module};
use crate::{AkmodsInfo, FromFileList, Module, base_recipe_path};
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
pub struct ModuleExt<'a> {

View file

@ -6,7 +6,7 @@ use miette::{Context, IntoDiagnostic, Result};
use oci_distribution::Reference;
use serde::{Deserialize, Serialize};
use crate::{maybe_version::MaybeVersion, Module, ModuleExt, StagesExt};
use crate::{Module, ModuleExt, StagesExt, maybe_version::MaybeVersion};
/// The build recipe.
///

View file

@ -3,10 +3,10 @@ use std::{borrow::Cow, path::PathBuf};
use blue_build_utils::syntax_highlighting::highlight_ser;
use bon::Builder;
use colored::Colorize;
use miette::{bail, Result};
use miette::{Result, bail};
use serde::{Deserialize, Serialize};
use crate::{base_recipe_path, Module, ModuleExt, StagesExt};
use crate::{Module, ModuleExt, StagesExt, base_recipe_path};
/// Contains the required fields for a stage.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]

View file

@ -7,7 +7,7 @@ use bon::Builder;
use miette::{Context, IntoDiagnostic, Report, Result};
use serde::{Deserialize, Serialize};
use crate::{base_recipe_path, FromFileList, Module, Stage};
use crate::{FromFileList, Module, Stage, base_recipe_path};
#[derive(Default, Serialize, Clone, Deserialize, Debug, Builder)]
pub struct StagesExt<'a> {

View file

@ -2,7 +2,7 @@ use std::path::PathBuf;
use log::error;
use clap::{command, crate_authors, Parser, Subcommand};
use clap::{Parser, Subcommand, command, crate_authors};
use clap_verbosity_flag::{InfoLevel, Verbosity};
use crate::shadow;

View file

@ -8,10 +8,10 @@ use bon::Builder;
use clap::Args;
use clap_complete::Shell;
use colored::Colorize;
use fuzzy_matcher::{skim::SkimMatcherV2, FuzzyMatcher};
use fuzzy_matcher::{FuzzyMatcher, skim::SkimMatcherV2};
use log::{debug, error, trace};
use miette::{IntoDiagnostic, Result};
use requestty::question::{completions, Completions};
use requestty::question::{Completions, completions};
use std::time::Duration;
use super::BlueBuildCommand;
@ -85,15 +85,22 @@ impl BugReportCommand {
.default(true)
.build();
println!("{} To avoid any sensitive data from being exposed, please review the included information before proceeding.", "Warning:".on_bright_red().bright_white());
println!("Data forwarded to GitHub is subject to GitHub's privacy policy. For more information, see https://docs.github.com/en/github/site-policy/github-privacy-statement.\n");
println!(
"{} To avoid any sensitive data from being exposed, please review the included information before proceeding.",
"Warning:".on_bright_red().bright_white()
);
println!(
"Data forwarded to GitHub is subject to GitHub's privacy policy. For more information, see https://docs.github.com/en/github/site-policy/github-privacy-statement.\n"
);
match requestty::prompt_one(question) {
Ok(answer) => {
if answer.as_bool().unwrap() {
let link = make_github_issue_link(&issue_body);
if let Err(e) = open::that(&link) {
println!("Failed to open issue report in your browser: {e}");
println!("Please copy the above report and open an issue manually, or try opening the following link:\n{link}");
println!(
"Please copy the above report and open an issue manually, or try opening the following link:\n{link}"
);
return Err(e).into_diagnostic();
}
} else {

View file

@ -2,12 +2,12 @@ use std::path::{Path, PathBuf};
use blue_build_process_management::{
drivers::{
BuildDriver, CiDriver, Driver, DriverArgs, SigningDriver,
opts::{
BuildTagPushOpts, CheckKeyPairOpts, CompressionType, GenerateImageNameOpts,
GenerateTagsOpts, SignVerifyOpts,
},
types::Platform,
BuildDriver, CiDriver, Driver, DriverArgs, SigningDriver,
},
logging::{color_str, gen_random_ansi_color},
};
@ -25,7 +25,7 @@ use blue_build_utils::{
use bon::Builder;
use clap::Args;
use log::{info, trace, warn};
use miette::{bail, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail};
use oci_distribution::Reference;
use tempfile::TempDir;
@ -332,8 +332,8 @@ impl BuildCommand {
#[cfg(feature = "rechunk")]
let images = if self.rechunk {
use blue_build_process_management::drivers::{
opts::{GetMetadataOpts, RechunkOpts},
InspectDriver, RechunkDriver,
opts::{GetMetadataOpts, RechunkOpts},
};
let base_image: Reference = format!("{}:{}", &recipe.base_image, &recipe.image_version)

View file

@ -4,7 +4,7 @@ use std::{
};
use blue_build_process_management::drivers::{
opts::GetMetadataOpts, types::Platform, CiDriver, Driver, DriverArgs, InspectDriver,
CiDriver, Driver, DriverArgs, InspectDriver, opts::GetMetadataOpts, types::Platform,
};
use blue_build_recipe::Recipe;
use blue_build_template::{ContainerFileTemplate, Template};
@ -14,7 +14,7 @@ use blue_build_utils::{
};
use bon::Builder;
use cached::proc_macro::cached;
use clap::{crate_version, Args};
use clap::{Args, crate_version};
use log::{debug, info, trace, warn};
use miette::{IntoDiagnostic, Result};
use oci_distribution::Reference;

View file

@ -7,16 +7,16 @@ use blue_build_recipe::Recipe;
use blue_build_utils::{constants::ARCHIVE_SUFFIX, string_vec, traits::CowCollecter};
use bon::Builder;
use clap::{Args, Subcommand, ValueEnum};
use miette::{bail, Context, IntoDiagnostic, Result};
use miette::{Context, IntoDiagnostic, Result, bail};
use oci_distribution::Reference;
use tempfile::TempDir;
use blue_build_process_management::{
drivers::{opts::RunOpts, Driver, DriverArgs, RunDriver},
drivers::{Driver, DriverArgs, RunDriver, opts::RunOpts},
run_volumes,
};
use super::{build::BuildCommand, BlueBuildCommand};
use super::{BlueBuildCommand, build::BuildCommand};
#[derive(Clone, Debug, Builder, Args)]
pub struct GenerateIsoCommand {

View file

@ -8,16 +8,16 @@ use std::{
};
use blue_build_process_management::drivers::{
opts::GenerateKeyPairOpts, CiDriver, Driver, DriverArgs, GitlabDriver, SigningDriver,
CiDriver, Driver, DriverArgs, GitlabDriver, SigningDriver, opts::GenerateKeyPairOpts,
};
use blue_build_template::{GitlabCiTemplate, InitReadmeTemplate, Template};
use blue_build_utils::constants::{COSIGN_PUB_PATH, RECIPE_FILE, RECIPE_PATH, TEMPLATE_REPO_URL};
use bon::Builder;
use clap::{crate_version, Args, ValueEnum};
use clap::{Args, ValueEnum, crate_version};
use comlexr::cmd;
use log::{debug, info, trace};
use miette::{bail, miette, Context, IntoDiagnostic, Report, Result};
use requestty::{questions, Answer, Answers, OnEsc};
use miette::{Context, IntoDiagnostic, Report, Result, bail, miette};
use requestty::{Answer, Answers, OnEsc, questions};
use semver::Version;
use crate::commands::BlueBuildCommand;
@ -202,8 +202,7 @@ impl InitCommand {
},
Input {
name: Self::REGISTRY,
message:
"What is the registry for the image? (e.g. ghcr.io or registry.gitlab.com)",
message: "What is the registry for the image? (e.g. ghcr.io or registry.gitlab.com)",
when: when!(self.common.registry.is_none()),
on_esc: OnEsc::Terminate,
},

View file

@ -3,7 +3,7 @@ use std::io::{self, Read};
use blue_build_process_management::drivers::{BuildDriver, Driver, DriverArgs, SigningDriver};
use blue_build_utils::credentials::{Credentials, CredentialsArgs};
use clap::Args;
use miette::{bail, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail};
use requestty::questions;
use super::BlueBuildCommand;

View file

@ -1,4 +1,4 @@
use blue_build_process_management::drivers::{opts::PruneOpts, BuildDriver, Driver, DriverArgs};
use blue_build_process_management::drivers::{BuildDriver, Driver, DriverArgs, opts::PruneOpts};
use bon::Builder;
use clap::Args;
use colored::Colorize;

View file

@ -17,7 +17,7 @@ use clap::Args;
use comlexr::cmd;
use indicatif::ProgressBar;
use log::{debug, trace};
use miette::{bail, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail};
use tempfile::TempDir;
use crate::{commands::build::BuildCommand, rpm_ostree_status::RpmOstreeStatus};

View file

@ -16,7 +16,7 @@ use bon::Builder;
use clap::Args;
use colored::Colorize;
use log::{debug, info, trace};
use miette::{bail, miette, Context, IntoDiagnostic, Report};
use miette::{Context, IntoDiagnostic, Report, bail, miette};
use rayon::prelude::*;
use schema_validator::SchemaValidator;
use serde::de::DeserializeOwned;

View file

@ -5,9 +5,9 @@ use bon::bon;
use jsonschema::paths::LocationSegment;
use miette::SourceSpan;
use yaml_rust2::{
Event,
parser::{MarkedEventReceiver, Parser},
scanner::Marker,
Event,
};
#[cfg(not(test))]
@ -147,7 +147,7 @@ where
return Err(YamlSpanError::ExpectIndexFoundKey {
key: key.to_owned(),
index,
})
});
}
(Event::SequenceStart(_, _), LocationSegment::Index(index)) => {
break self.sequence(index, 0);
@ -159,7 +159,7 @@ where
self.skip_mapping(marker.index());
}
(Event::MappingEnd, _) => {
return Err(YamlSpanError::EndOfMapNoKey(expected_key.to_string()))
return Err(YamlSpanError::EndOfMapNoKey(expected_key.to_string()));
}
event => unreachable!("{event:?}"),
}
@ -265,7 +265,7 @@ where
return Err(YamlSpanError::UnexpectedScalar {
value: value.to_owned(),
segment: segment.to_string(),
})
});
}
(Event::MappingStart(_, _), Some(LocationSegment::Property(key))) => {
self.key(LocationSegment::Property(key))?
@ -290,7 +290,7 @@ where
mod test {
use std::sync::Arc;
use miette::{miette, LabeledSpan};
use miette::{LabeledSpan, miette};
use rstest::rstest;
use crate::commands::validate::location::Location;

View file

@ -2,7 +2,7 @@ use std::{borrow::Cow, path::Path};
use comlexr::cmd;
use log::trace;
use miette::{bail, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, bail};
use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
@ -208,18 +208,22 @@ mod test {
#[test]
fn test_booted_image() {
assert!(create_image_status()
.booted_image()
.expect("Contains image")
.ends_with("cli/test"));
assert!(
create_image_status()
.booted_image()
.expect("Contains image")
.ends_with("cli/test")
);
}
#[test]
fn test_staged_image() {
assert!(create_archive_staged_status()
.staged_image()
.expect("Contains image")
.ends_with(&format!("cli_test.{ARCHIVE_SUFFIX}")));
assert!(
create_archive_staged_status()
.staged_image()
.expect("Contains image")
.ends_with(&format!("cli_test.{ARCHIVE_SUFFIX}"))
);
}
#[test]
@ -230,8 +234,10 @@ mod test {
#[test]
fn test_is_booted_archive() {
assert!(!create_archive_status()
.is_booted_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}"))));
assert!(
!create_archive_status()
.is_booted_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}")))
);
assert!(create_archive_status().is_booted_on_archive(
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
));
@ -239,8 +245,10 @@ mod test {
#[test]
fn test_is_staged_archive() {
assert!(!create_archive_staged_status()
.is_staged_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}"))));
assert!(
!create_archive_staged_status()
.is_staged_on_archive(Path::new(LOCAL_BUILD).join(format!("cli.{ARCHIVE_SUFFIX}")))
);
assert!(create_archive_staged_status().is_staged_on_archive(
Path::new(LOCAL_BUILD).join(format!("cli_test.{ARCHIVE_SUFFIX}"))
));

View file

@ -2,7 +2,7 @@ use std::{borrow::Cow, fs, path::Path, process};
use blue_build_recipe::{MaybeVersion, Recipe};
use blue_build_utils::constants::{
CONFIG_PATH, CONTAINERFILES_PATH, CONTAINER_FILE, COSIGN_PUB_PATH, FILES_PATH,
CONFIG_PATH, CONTAINER_FILE, CONTAINERFILES_PATH, COSIGN_PUB_PATH, FILES_PATH,
};
use bon::Builder;
use chrono::Utc;
@ -102,7 +102,9 @@ fn print_containerfile(containerfile: &str) -> String {
let path = if containerfiles_path.exists() && containerfiles_path.is_dir() {
containerfiles_path.join(format!("{containerfile}/{CONTAINER_FILE}"))
} else {
warn!("Use of {CONFIG_PATH} is deprecated for the containerfile module, please move your containerfile directories into {CONTAINERFILES_PATH}");
warn!(
"Use of {CONFIG_PATH} is deprecated for the containerfile module, please move your containerfile directories into {CONTAINERFILES_PATH}"
);
legacy_path.join(format!("containerfiles/{containerfile}/{CONTAINER_FILE}"))
};
@ -131,7 +133,9 @@ fn config_dir_exists() -> bool {
let exists = path.exists() && path.is_dir();
if exists {
warn!("Use of the {CONFIG_PATH} directory is deprecated. Please move your non-recipe files into {FILES_PATH}");
warn!(
"Use of the {CONFIG_PATH} directory is deprecated. Please move your non-recipe files into {FILES_PATH}"
);
}
exists

View file

@ -1,8 +1,8 @@
use std::env;
use std::path::PathBuf;
use syntect::dumps;
use syntect::parsing::syntax_definition::SyntaxDefinition;
use syntect::parsing::SyntaxSetBuilder;
use syntect::parsing::syntax_definition::SyntaxDefinition;
fn main() {
let mut ssb = SyntaxSetBuilder::new();

View file

@ -113,7 +113,9 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option<CommandOutput
}
Ok(None) => {
log::warn!("Executing command {:?} timed out.", cmd.get_program());
log::warn!("You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing.");
log::warn!(
"You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing."
);
None
}
Err(error) => {

View file

@ -18,15 +18,15 @@ use std::{
use base64::prelude::*;
use blake2::{
digest::{Update, VariableOutput},
Blake2bVar,
digest::{Update, VariableOutput},
};
use cached::proc_macro::once;
use chrono::Local;
use comlexr::cmd;
use format_serde_error::SerdeError;
use log::{trace, warn};
use miette::{miette, Context, IntoDiagnostic, Result};
use miette::{Context, IntoDiagnostic, Result, miette};
use crate::constants::CONTAINER_FILE;
@ -110,7 +110,7 @@ where
warn!("Failed operation, will retry {retries} more time(s). Error:\n{e:?}");
thread::sleep(Duration::from_secs(delay_secs));
}
};
}
}
}

View file

@ -2,7 +2,7 @@ use std::str::FromStr;
use miette::bail;
use semver::Prerelease;
use serde::{de::Error, Deserialize, Serialize};
use serde::{Deserialize, Serialize, de::Error};
#[derive(Debug, Clone, Serialize)]
pub struct Version(semver::Version);

View file

@ -1,6 +1,6 @@
use clap::ValueEnum;
use log::trace;
use miette::{miette, IntoDiagnostic, Result};
use miette::{IntoDiagnostic, Result, miette};
use serde::ser::Serialize;
use syntect::{dumps, easy::HighlightLines, highlighting::ThemeSet, parsing::SyntaxSet};

View file

@ -4,7 +4,7 @@ use std::{
thread::{self, ThreadId},
};
use miette::{miette, Result};
use miette::{Result, miette};
use crate::string;