From 9be0f98f71fe8071ab839ac1036b4064ac3172b4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 29 Jun 2026 00:03:00 +0900 Subject: chore(lint): ban bare `use anyhow::Result` and fully qualify it Add a no_banned_use linter that forbids importing anyhow::Result, and update all call sites to reference it via its fully-qualified path so it is never confused with std::result::Result. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/util/svn.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'crates/shirabe/src/util/svn.rs') diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs index 5eed44d..4c01a3a 100644 --- a/crates/shirabe/src/util/svn.rs +++ b/crates/shirabe/src/util/svn.rs @@ -6,7 +6,6 @@ use crate::io::IOInterfaceImmutable; use crate::io::io_interface; use crate::util::Platform; use crate::util::ProcessExecutor; -use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ @@ -92,7 +91,7 @@ impl Svn { cwd: Option<&str>, path: Option<&str>, verbose: bool, - ) -> Result { + ) -> anyhow::Result { // Ensure we are allowed to use this URL by config self.config.borrow_mut().prohibit_url_by_config( url, @@ -119,7 +118,7 @@ impl Svn { path: &str, cwd: Option<&str>, verbose: bool, - ) -> Result { + ) -> anyhow::Result { // A local command has no remote url self.execute_with_auth_retry(command, cwd, "", Some(path), verbose) .map(|o| o.unwrap_or_default()) @@ -133,7 +132,7 @@ impl Svn { url: &str, path: Option<&str>, verbose: bool, - ) -> Result> { + ) -> anyhow::Result> { // Regenerate the command at each try, to use the newly user-provided credentials let command = self.get_command(svn_command.clone(), url, path); @@ -212,7 +211,7 @@ impl Svn { /// Repositories requests credentials, let's put them in. /// /// @throws \RuntimeException - pub(crate) fn do_auth_dance(&mut self) -> Result<&mut Self> { + pub(crate) fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> { // cannot ask for credentials in non interactive mode if !self.io.is_interactive() { return Err(RuntimeException { @@ -314,7 +313,7 @@ impl Svn { /// Get the password for the svn command. Can be empty. /// /// @throws \LogicException - pub(crate) fn get_password(&self) -> Result { + pub(crate) fn get_password(&self) -> anyhow::Result { if self.credentials.is_none() { return Err(LogicException { message: "No svn auth detected.".to_string(), @@ -329,7 +328,7 @@ impl Svn { /// Get the username for the svn command. /// /// @throws \LogicException - pub(crate) fn get_username(&self) -> Result { + pub(crate) fn get_username(&self) -> anyhow::Result { if self.credentials.is_none() { return Err(LogicException { message: "No svn auth detected.".to_string(), -- cgit v1.3.1