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/repository/vcs/svn_driver.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'crates/shirabe/src/repository/vcs/svn_driver.rs') diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs index cb4ff87..7df7f02 100644 --- a/crates/shirabe/src/repository/vcs/svn_driver.rs +++ b/crates/shirabe/src/repository/vcs/svn_driver.rs @@ -11,7 +11,6 @@ use crate::util::Filesystem; use crate::util::ProcessExecutor; use crate::util::Svn as SvnUtil; use crate::util::Url; -use anyhow::Result; use chrono::{DateTime, FixedOffset, Utc}; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; @@ -68,7 +67,7 @@ impl SvnDriver { } } - pub fn initialize(&mut self) -> Result<()> { + pub fn initialize(&mut self) -> anyhow::Result<()> { let normalized = Self::normalize_url(&self.inner.url); self.inner.url = normalized.trim_end_matches('/').to_string(); self.base_url = self.inner.url.clone(); @@ -164,7 +163,7 @@ impl SvnDriver { pub fn get_composer_information( &mut self, identifier: &str, - ) -> Result>> { + ) -> anyhow::Result>> { if !self.inner.info_cache.contains_key(identifier) { if self.should_cache(identifier) && let Some(mut res) = self @@ -255,7 +254,11 @@ impl SvnDriver { Ok(cached) } - pub fn get_file_content(&mut self, file: &str, identifier: &str) -> Result> { + pub fn get_file_content( + &mut self, + file: &str, + identifier: &str, + ) -> anyhow::Result> { let identifier = format!("/{}/", trim(identifier, Some("/"))); let (path, rev) = if let Some(m) = @@ -292,7 +295,10 @@ impl SvnDriver { Ok(Some(output)) } - pub fn get_change_date(&mut self, identifier: &str) -> Result>> { + pub fn get_change_date( + &mut self, + identifier: &str, + ) -> anyhow::Result>> { let identifier = format!("/{}/", trim(identifier, Some("/"))); let (path, rev) = if let Some(m) = @@ -329,7 +335,7 @@ impl SvnDriver { Ok(None) } - pub fn get_tags(&mut self) -> Result<&IndexMap> { + pub fn get_tags(&mut self) -> anyhow::Result<&IndexMap> { if self.tags.is_none() { let mut tags: IndexMap = IndexMap::new(); @@ -373,7 +379,7 @@ impl SvnDriver { Ok(self.tags.as_ref().unwrap()) } - pub fn get_branches(&mut self) -> Result<&IndexMap> { + pub fn get_branches(&mut self) -> anyhow::Result<&IndexMap> { if self.branches.is_none() { let mut branches: IndexMap = IndexMap::new(); @@ -464,7 +470,7 @@ impl SvnDriver { _config: std::rc::Rc>, url: &str, deep: bool, - ) -> Result { + ) -> anyhow::Result { let url = Self::normalize_url(url); if Preg::is_match(r"#(^svn://|^svn\+ssh://|svn\.)#i", &url) { return Ok(true); @@ -527,7 +533,7 @@ impl SvnDriver { /// @param non-empty-list $command The svn command to run. /// @param string $url The SVN URL. /// @throws \RuntimeException - pub(crate) fn execute(&mut self, command: Vec, url: &str) -> Result { + pub(crate) fn execute(&mut self, command: Vec, url: &str) -> anyhow::Result { if self.util.is_none() { self.util = Some(SvnUtil::new( self.base_url.clone(), -- cgit v1.3.1