diff --git a/src/cli/directory_check.rs b/src/cli/directory_check.rs index 24335b36..c5019245 100644 --- a/src/cli/directory_check.rs +++ b/src/cli/directory_check.rs @@ -34,9 +34,11 @@ fn _check() -> anyhow::Result> { pub fn check_and_error() -> anyhow::Result<()> { match _check().context("failed directory check")? { Some(dir) => { - print::error!("{BRANDING_CLI} no longer uses `{dir}` to store data \ + print::error!( + "{BRANDING_CLI} no longer uses `{dir}` to store data \ and now uses standard locations of your OS.", - dir = dir.display()); + dir = dir.display() + ); print_markdown!( "To upgrade the directory layout, run: \n\ ```\n\ diff --git a/src/cloud/auth.rs b/src/cloud/auth.rs index 5ae1149c..4b70f0d3 100644 --- a/src/cloud/auth.rs +++ b/src/cloud/auth.rs @@ -247,8 +247,10 @@ pub fn logout(c: &options::Logout, options: &CloudOptions) -> anyhow::Result<()> } skipped = !removed; } else { - print::warn!("Already logged out from {BRANDING_CLOUD} for profile \"{}\".", - client.profile.as_deref().unwrap_or("default")); + print::warn!( + "Already logged out from {BRANDING_CLOUD} for profile \"{}\".", + client.profile.as_deref().unwrap_or("default") + ); } } if !warnings.is_empty() { diff --git a/src/commands/execute.rs b/src/commands/execute.rs index 2e14d2c6..8847774d 100644 --- a/src/commands/execute.rs +++ b/src/commands/execute.rs @@ -77,9 +77,7 @@ pub async fn common( Some(addr) => { println!("{}", addr.0); } - None => print::error!( - "pgaddr requires {BRANDING} to run in DEV mode" - ), + None => print::error!("pgaddr requires {BRANDING} to run in DEV mode"), } } }, diff --git a/src/commands/ui.rs b/src/commands/ui.rs index 97861653..0170afb4 100644 --- a/src/commands/ui.rs +++ b/src/commands/ui.rs @@ -112,9 +112,7 @@ fn _get_local_ui_url(cmd: &UI, cfg: &edgedb_tokio::Config) -> anyhow::Result {} Ok(reqwest::StatusCode::NOT_FOUND) => { - print::error!( - "Web UI not served correctly by specified {BRANDING} server." - ); + print::error!("Web UI not served correctly by specified {BRANDING} server."); msg!( " Try running the \ server with `--admin-ui=enabled`." @@ -123,8 +121,10 @@ fn _get_local_ui_url(cmd: &UI, cfg: &edgedb_tokio::Config) -> anyhow::Result { log::info!("GET {} returned status code {}", url, status); - print::error!("Web UI not served correctly by specified {BRANDING} server. \ - Try `edgedb instance logs -I ` to see details."); + print::error!( + "Web UI not served correctly by specified {BRANDING} server. \ + Try `edgedb instance logs -I ` to see details." + ); return Err(ExitCode::new(3).into()); } Err(e) => { diff --git a/src/migrations/extract.rs b/src/migrations/extract.rs index 048ce575..089da589 100644 --- a/src/migrations/extract.rs +++ b/src/migrations/extract.rs @@ -131,8 +131,7 @@ pub async fn extract( let to_migrations_dir = src_ctx.schema_dir.join("migrations"); if !to_migrations_dir.is_dir() { if src_ctx.schema_dir.is_dir() { - print::warn!("Creating directory {}", - to_migrations_dir.display()); + print::warn!("Creating directory {}", to_migrations_dir.display()); fs::create_dir(to_migrations_dir)?; } else { anyhow::bail!( diff --git a/src/migrations/status.rs b/src/migrations/status.rs index b287ac58..a503f4f7 100644 --- a/src/migrations/status.rs +++ b/src/migrations/status.rs @@ -91,21 +91,25 @@ pub async fn migrations_applied( iter.next(); // skip db_migration itself let first = iter.next().unwrap(); // we know it's not last let count = iter.count() + 1; - print::error!("Database is at migration {db:?} while sources \ + print::error!( + "Database is at migration {db:?} while sources \ contain {n} migrations ahead, \ starting from {first:?}({first_file})", db = db_migration, n = count, first = first, - first_file = migrations[first].path.display()); + first_file = migrations[first].path.display() + ); } else { print::error!("Database revision {db_migration} not found in the filesystem."); eprintln!(" Consider updating sources."); } } else { - print::error!("Database is empty, while {} migrations \ + print::error!( + "Database is empty, while {} migrations \ have been found in the filesystem.", - migrations.len()); + migrations.len() + ); eprintln!(" Run `{BRANDING_CLI_CMD} migrate` to apply."); } } diff --git a/src/migrations/upgrade_check.rs b/src/migrations/upgrade_check.rs index d5f19f61..ff91e2a9 100644 --- a/src/migrations/upgrade_check.rs +++ b/src/migrations/upgrade_check.rs @@ -23,7 +23,7 @@ use crate::portable::config::Config; use crate::portable::install; use crate::portable::local::InstallInfo; use crate::portable::repository::{self, PackageInfo, Query}; -use crate::print::{msg, success, self, Highlight}; +use crate::print::{self, msg, success, Highlight}; use crate::process; use crate::watch::wait_changes; diff --git a/src/non_interactive.rs b/src/non_interactive.rs index 31f0ecee..102e0e95 100644 --- a/src/non_interactive.rs +++ b/src/non_interactive.rs @@ -65,8 +65,10 @@ pub async fn noninteractive_main(q: &Query, options: &Options) -> Result<(), any run_query(&mut conn, query, options, fmt).await?; } } else { - print::error!("either a --file option or \ - a positional argument is required."); + print::error!( + "either a --file option or \ + a positional argument is required." + ); } Ok(()) diff --git a/src/portable/control.rs b/src/portable/control.rs index 34b2d05e..4b252386 100644 --- a/src/portable/control.rs +++ b/src/portable/control.rs @@ -227,9 +227,7 @@ pub fn start(options: &Start) -> anyhow::Result<()> { } } InstanceName::Cloud { .. } => { - print::error!( - "Starting {BRANDING_CLOUD} instances is not yet supported." - ); + print::error!("Starting {BRANDING_CLOUD} instances is not yet supported."); return Err(ExitCode::new(1))?; } }; @@ -415,9 +413,7 @@ pub fn stop(options: &Stop) -> anyhow::Result<()> { } } InstanceName::Cloud { .. } => { - print::error!( - "Stopping {BRANDING_CLOUD} instances is not yet supported." - ); + print::error!("Stopping {BRANDING_CLOUD} instances is not yet supported."); return Err(ExitCode::new(1))?; } }; diff --git a/src/portable/create.rs b/src/portable/create.rs index d2e59f6f..ea478a4b 100644 --- a/src/portable/create.rs +++ b/src/portable/create.rs @@ -73,9 +73,11 @@ pub fn create(cmd: &Create, opts: &crate::options::Options) -> anyhow::Result<() Err(ExitCode::new(exit_codes::DOCKER_CONTAINER))?; } if cmd.start_conf.is_some() { - print::warn!("The option `--start-conf` is deprecated. \ + print::warn!( + "The option `--start-conf` is deprecated. \ Use `edgedb instance start/stop` to control \ - the instance."); + the instance." + ); } let mut client = cloud::client::CloudClient::new(&opts.cloud_options)?; @@ -185,8 +187,10 @@ pub fn create(cmd: &Create, opts: &crate::options::Options) -> anyhow::Result<() Ok(()) => {} Err(e) => { log::warn!("Error running {BRANDING} as a service: {e:#}"); - print::warn!("{BRANDING} will not start on next login. \ - Trying to start database in the background..."); + print::warn!( + "{BRANDING} will not start on next login. \ + Trying to start database in the background..." + ); control::start(&Start { name: None, instance: Some(inst_name), diff --git a/src/portable/link.rs b/src/portable/link.rs index bebde7e7..5e3e702a 100644 --- a/src/portable/link.rs +++ b/src/portable/link.rs @@ -295,8 +295,10 @@ pub fn link(cmd: &Link, opts: &Options) -> anyhow::Result<()> { .default(&default) .ask()?; if !is_valid_local_instance_name(&name) { - print::error!("Instance name must be a valid identifier, \ - (regex: ^[a-zA-Z_0-9]+(-[a-zA-Z_0-9]+)*$)"); + print::error!( + "Instance name must be a valid identifier, \ + (regex: ^[a-zA-Z_0-9]+(-[a-zA-Z_0-9]+)*$)" + ); continue; } break (credentials::path(&name)?, name); diff --git a/src/portable/linux.rs b/src/portable/linux.rs index 1710d4c7..d9965cf7 100644 --- a/src/portable/linux.rs +++ b/src/portable/linux.rs @@ -424,9 +424,7 @@ pub fn logs(options: &Logs) -> anyhow::Result<()> { let name = match instance_arg(&options.name, &options.instance)? { InstanceName::Local(name) => name, InstanceName::Cloud { .. } => { - print::error!( - "This operation is not yet supported on {BRANDING_CLOUD} instances." - ); + print::error!("This operation is not yet supported on {BRANDING_CLOUD} instances."); return Err(ExitCode::new(1))?; } }; diff --git a/src/portable/options.rs b/src/portable/options.rs index c0f79beb..11d76691 100644 --- a/src/portable/options.rs +++ b/src/portable/options.rs @@ -16,7 +16,7 @@ use crate::portable::local::{ }; use crate::portable::repository::Channel; use crate::portable::ver; -use crate::print::{err_marker, msg, self}; +use crate::print::{self, err_marker, msg}; use crate::process::{self, IntoArg}; const DOMAIN_LABEL_MAX_LENGTH: usize = 63; diff --git a/src/portable/project.rs b/src/portable/project.rs index ac559b42..27ab78dc 100644 --- a/src/portable/project.rs +++ b/src/portable/project.rs @@ -282,9 +282,11 @@ pub fn init(options: &Init, opts: &crate::options::Options) -> anyhow::Result<() } if options.server_start_conf.is_some() { - print::warn!("The option `--server-start-conf` is deprecated. \ + print::warn!( + "The option `--server-start-conf` is deprecated. \ Use `edgedb instance start/stop` to control \ - the instance."); + the instance." + ); } let Some((project_dir, config_path)) = project_dir(options.project_dir.as_deref())? else { @@ -836,8 +838,10 @@ fn do_init( Ok(()) => {} Err(e) => { log::warn!("Error running {BRANDING} as a service: {e:#}"); - print::warn!("{BRANDING} will not start on next login. \ - Trying to start database in the background..."); + print::warn!( + "{BRANDING} will not start on next login. \ + Trying to start database in the background..." + ); control::start(&Start { name: None, instance: Some(inst_name.clone()), @@ -1373,10 +1377,12 @@ impl Handle<'_> { match self.get_version() { Ok(inst_ver) if ver_query.matches(&inst_ver) => {} Ok(inst_ver) => { - print::warn!("WARNING: existing instance has version {}, \ + print::warn!( + "WARNING: existing instance has version {}, \ but {} is required by {CONFIG_FILE_DISPLAY_NAME}", inst_ver, - ver_query.display()); + ver_query.display() + ); } Err(e) => { log::warn!("Could not check instance's version: {:#}", e); @@ -1829,9 +1835,11 @@ pub fn find_project_stash_dirs( } pub fn print_instance_in_use_warning(name: &str, project_dirs: &[PathBuf]) { - print::warn!("Instance {:?} is used by the following project{}:", + print::warn!( + "Instance {:?} is used by the following project{}:", name, - if project_dirs.len() > 1 { "s" } else { "" }); + if project_dirs.len() > 1 { "s" } else { "" } + ); for dir in project_dirs { let dest = match read_project_path(dir) { Ok(path) => path, @@ -1965,8 +1973,10 @@ fn print_other_project_warning( } } if !project_dirs.is_empty() { - print::warn!("Warning: the instance {name} is still used by the following \ - projects:"); + print::warn!( + "Warning: the instance {name} is still used by the following \ + projects:" + ); for pd in &project_dirs { eprintln!(" {}", pd.display()); } diff --git a/src/portable/reset_password.rs b/src/portable/reset_password.rs index 0dafe2cb..f86fa690 100644 --- a/src/portable/reset_password.rs +++ b/src/portable/reset_password.rs @@ -47,9 +47,7 @@ pub fn reset_password(options: &ResetPassword) -> anyhow::Result<()> { } } InstanceName::Cloud { .. } => { - print::error!( - "This operation is not yet supported on {BRANDING_CLOUD} instances." - ); + print::error!("This operation is not yet supported on {BRANDING_CLOUD} instances."); return Err(ExitCode::new(1))?; } }; diff --git a/src/portable/revert.rs b/src/portable/revert.rs index 3a772d03..6ecbf28f 100644 --- a/src/portable/revert.rs +++ b/src/portable/revert.rs @@ -30,9 +30,7 @@ pub fn revert(options: &Revert) -> anyhow::Result<()> { } } InstanceName::Cloud { .. } => { - print::error!( - "This operation is not yet supported on {BRANDING_CLOUD} instances." - ); + print::error!("This operation is not yet supported on {BRANDING_CLOUD} instances."); return Err(ExitCode::new(1))?; } };