From 2bf8f6fb846f8e5a670fd19a844c6c795ceb69cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Balatoni?= Date: Sun, 25 Oct 2026 10:05:15 +0100 Subject: [PATCH] style(cli): satisfy pinned clippy for the GitHub host lookups --- lib/apps/fabro-cli/src/commands/graph.rs | 3 ++- lib/apps/fabro-cli/src/commands/preflight.rs | 3 ++- lib/apps/fabro-cli/src/commands/repo/init.rs | 3 ++- lib/apps/fabro-cli/src/commands/run/create.rs | 4 ++-- lib/apps/fabro-cli/src/commands/run/petri_worker.rs | 4 ++-- lib/apps/fabro-cli/src/commands/run/resolution.rs | 7 ++++--- lib/apps/fabro-cli/src/commands/validate.rs | 3 ++- lib/apps/fabro-cli/src/gh.rs | 4 ++++ 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/lib/apps/fabro-cli/src/commands/graph.rs b/lib/apps/fabro-cli/src/commands/graph.rs index be3b505ea..a2bda5e08 100644 --- a/lib/apps/fabro-cli/src/commands/graph.rs +++ b/lib/apps/fabro-cli/src/commands/graph.rs @@ -22,6 +22,7 @@ use crate::args::{GraphArgs, GraphDirection, GraphOutputFormat}; use crate::command_context::CommandContext; use crate::commands::run::output::api_diagnostics_to_local; use crate::shared::{absolute_or_current, print_diagnostics, print_json_pretty, relative_path}; +use crate::user_config; pub(crate) async fn run( args: &GraphArgs, @@ -39,7 +40,7 @@ pub(crate) async fn run( cwd: ctx.cwd().to_path_buf(), environment_defaults: fabro_environment::seeded_catalog_layer(), user_settings_path: Some(active_settings_path(None)), - github_host: crate::user_config::github_host()?, + github_host: user_config::github_host()?, ..Default::default() })?; let client = ctx.server().await?; diff --git a/lib/apps/fabro-cli/src/commands/preflight.rs b/lib/apps/fabro-cli/src/commands/preflight.rs index d122c3022..2f3426e9f 100644 --- a/lib/apps/fabro-cli/src/commands/preflight.rs +++ b/lib/apps/fabro-cli/src/commands/preflight.rs @@ -12,6 +12,7 @@ use crate::commands::run::output::{ use crate::commands::run::overrides::preflight_args_overrides; use crate::manifest_args::preflight_manifest_args; use crate::shared::{cyan_spinner, print_json_pretty}; +use crate::user_config; pub(crate) async fn execute( mut args: PreflightArgs, @@ -32,7 +33,7 @@ pub(crate) async fn execute( args: preflight_manifest_args(&args), environment_defaults: fabro_environment::seeded_catalog_layer(), user_settings_path: Some(active_settings_path(None)), - github_host: crate::user_config::github_host()?, + github_host: user_config::github_host()?, })?; let spinner = (!ctx.json_output()).then(|| cyan_spinner("Running checks...")); diff --git a/lib/apps/fabro-cli/src/commands/repo/init.rs b/lib/apps/fabro-cli/src/commands/repo/init.rs index 430dd16a8..e537d3760 100644 --- a/lib/apps/fabro-cli/src/commands/repo/init.rs +++ b/lib/apps/fabro-cli/src/commands/repo/init.rs @@ -11,6 +11,7 @@ use tokio::task::spawn_blocking; use crate::args::{RepoInitArgs, ServerTargetArgs}; use crate::command_context::CommandContext; +use crate::user_config; #[expect( clippy::disallowed_methods, @@ -193,7 +194,7 @@ async fn check_github_app_installation(target: &ServerTargetArgs, base_ctx: &Com }; // Convert SSH URL to HTTPS and parse owner/repo - let Ok(host) = crate::user_config::github_host() else { + let Ok(host) = user_config::github_host() else { return; // Unreadable server settings — skip silently }; let https_url = fabro_github::ssh_url_to_https(&remote_url); diff --git a/lib/apps/fabro-cli/src/commands/run/create.rs b/lib/apps/fabro-cli/src/commands/run/create.rs index bcf4c9eb7..9b5fc50c3 100644 --- a/lib/apps/fabro-cli/src/commands/run/create.rs +++ b/lib/apps/fabro-cli/src/commands/run/create.rs @@ -14,7 +14,7 @@ use super::{resolution, selection}; use crate::args::RunArgs; use crate::command_context::CommandContext; use crate::commands::resolve_run_id; -use crate::user_config::{RunSettingsKeyPresence, read_project_run_settings_key_presence}; +use crate::user_config::{self, RunSettingsKeyPresence, read_project_run_settings_key_presence}; pub(crate) struct CreatedRun { pub(crate) run_id: RunId, @@ -105,7 +105,7 @@ pub(crate) async fn create_run( && args.target_repo_selector.is_none() => { fabro_manifest::configured_repo_origin_url_for_location( - &crate::user_config::github_host()?, + &user_config::github_host()?, package.workflow_location(), )? } diff --git a/lib/apps/fabro-cli/src/commands/run/petri_worker.rs b/lib/apps/fabro-cli/src/commands/run/petri_worker.rs index c17478ab6..4af4fe9c5 100644 --- a/lib/apps/fabro-cli/src/commands/run/petri_worker.rs +++ b/lib/apps/fabro-cli/src/commands/run/petri_worker.rs @@ -109,7 +109,7 @@ use tracing::{info, warn}; use super::publish; use super::runner::{self, WorkerTitlePhase}; use crate::args::RunWorkerMode; -use crate::command_context; +use crate::{command_context, user_config}; /// What the worker holds when it hands a run to Petri. pub(super) struct PetriWorker<'a> { @@ -221,7 +221,7 @@ pub(super) async fn execute(worker: PetriWorker<'_>) -> Result<()> { None } }; - let github_host = crate::user_config::github_host()?; + let github_host = user_config::github_host()?; let read_tokens = publish::read_token_source(&worker.run_state.spec, github.as_ref(), &github_host); runtime.stage_credentials = StageCredentials::for_run( diff --git a/lib/apps/fabro-cli/src/commands/run/resolution.rs b/lib/apps/fabro-cli/src/commands/run/resolution.rs index f953f6178..5e2ca3920 100644 --- a/lib/apps/fabro-cli/src/commands/run/resolution.rs +++ b/lib/apps/fabro-cli/src/commands/run/resolution.rs @@ -7,6 +7,7 @@ use tokio::task; use super::remote_workflow::{Interruption, NativeGit}; use super::selection::{TargetSelection, WorkflowSelection}; +use crate::user_config; /// Owns the canonical collector result without copying its contents. Local /// location metadata remains available for settings warnings and target @@ -55,7 +56,7 @@ pub(super) async fn workflow( selector, revision, } => { - let git = NativeGit::new(crate::user_config::github_host()?); + let git = NativeGit::new(user_config::github_host()?); let (repository, selector, revision) = (repository.clone(), selector.clone(), revision.clone()); let closure = interruption @@ -84,7 +85,7 @@ pub(super) async fn target( if !provider.clones_workspace() { bail!("Git targets require a clone-enabled environment"); } - let git = NativeGit::new(crate::user_config::github_host()?); + let git = NativeGit::new(user_config::github_host()?); let (repository, branch) = (repository.clone(), branch.clone()); let target = interruption .owned(move |cancel| async move { @@ -101,7 +102,7 @@ pub(super) async fn target( // The existing observer can push/query Git synchronously. Preserve its // behavior without blocking a Tokio worker or promising a new timeout. let provider = provider.clone(); - let host = crate::user_config::github_host()?; + let host = user_config::github_host()?; let configured_repo_origin_url = configured_repo_origin_url.map(str::to_owned); let derived = task::spawn_blocking(move || { fabro_manifest::derive_run_target_for_provider( diff --git a/lib/apps/fabro-cli/src/commands/validate.rs b/lib/apps/fabro-cli/src/commands/validate.rs index 16e3e7c1a..e763b6451 100644 --- a/lib/apps/fabro-cli/src/commands/validate.rs +++ b/lib/apps/fabro-cli/src/commands/validate.rs @@ -10,6 +10,7 @@ use crate::args::ValidateArgs; use crate::command_context::CommandContext; use crate::commands::run::output::api_diagnostics_to_local; use crate::shared::{print_diagnostics, print_json_pretty, relative_path}; +use crate::user_config; pub(crate) fn run( args: &ValidateArgs, @@ -22,7 +23,7 @@ pub(crate) fn run( cwd: base_ctx.cwd().to_path_buf(), environment_defaults: fabro_environment::seeded_catalog_layer(), user_settings_path: Some(active_settings_path(None)), - github_host: crate::user_config::github_host()?, + github_host: user_config::github_host()?, ..Default::default() })?; let response = manifest_validation::validate_manifest(&RunLayer::default(), &built.manifest)?; diff --git a/lib/apps/fabro-cli/src/gh.rs b/lib/apps/fabro-cli/src/gh.rs index 09742392b..20c204d50 100644 --- a/lib/apps/fabro-cli/src/gh.rs +++ b/lib/apps/fabro-cli/src/gh.rs @@ -123,6 +123,10 @@ mod tests { #[cfg(unix)] #[tokio::test] + #[expect( + clippy::disallowed_methods, + reason = "unit test stages a fake gh script and reads its argument log with sync std::fs" + )] async fn gh_invocations_target_the_configured_host() { use std::os::unix::fs::PermissionsExt;