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) --- .../shirabe/src/downloader/perforce_downloader.rs | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'crates/shirabe/src/downloader/perforce_downloader.rs') diff --git a/crates/shirabe/src/downloader/perforce_downloader.rs b/crates/shirabe/src/downloader/perforce_downloader.rs index 56d6957..4ca9b64 100644 --- a/crates/shirabe/src/downloader/perforce_downloader.rs +++ b/crates/shirabe/src/downloader/perforce_downloader.rs @@ -14,7 +14,6 @@ use crate::util::Filesystem; use crate::util::Perforce; use crate::util::PerforceInterface; use crate::util::ProcessExecutor; -use anyhow::Result; use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; @@ -111,7 +110,7 @@ impl VcsDownloader for PerforceDownloader { _path: &str, _url: &str, _prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { Ok(None) } @@ -120,7 +119,7 @@ impl VcsDownloader for PerforceDownloader { package: PackageInterfaceHandle, path: &str, url: &str, - ) -> Result> { + ) -> anyhow::Result> { let source_ref = package.get_source_reference().map(|s| s.to_string()); let label = self.get_label_from_source_reference(source_ref.clone().unwrap_or_default()); @@ -148,7 +147,7 @@ impl VcsDownloader for PerforceDownloader { target: PackageInterfaceHandle, path: &str, url: &str, - ) -> Result> { + ) -> anyhow::Result> { self.do_install(target, path, url).await } @@ -157,7 +156,7 @@ impl VcsDownloader for PerforceDownloader { from_reference: &str, to_reference: &str, _path: &str, - ) -> Result { + ) -> anyhow::Result { Ok(self .perforce .as_mut() @@ -176,7 +175,7 @@ impl ChangeReportInterface for PerforceDownloader { &mut self, _package: PackageInterfaceHandle, _path: &str, - ) -> Result> { + ) -> anyhow::Result> { self.inner .io .write_error("Perforce driver does not check for local changes before overriding"); @@ -215,7 +214,7 @@ impl DownloaderInterface for PerforceDownloader { path: &str, prev_package: Option, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::download(self, package, path, prev_package).await } @@ -225,7 +224,7 @@ impl DownloaderInterface for PerforceDownloader { package: PackageInterfaceHandle, path: &str, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { ::prepare(self, r#type, package, path, prev_package).await } @@ -234,7 +233,7 @@ impl DownloaderInterface for PerforceDownloader { package: PackageInterfaceHandle, path: &str, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::install(self, package, path).await } @@ -243,7 +242,7 @@ impl DownloaderInterface for PerforceDownloader { initial: PackageInterfaceHandle, target: PackageInterfaceHandle, path: &str, - ) -> Result> { + ) -> anyhow::Result> { ::update(self, initial, target, path).await } @@ -252,7 +251,7 @@ impl DownloaderInterface for PerforceDownloader { package: PackageInterfaceHandle, path: &str, _output: bool, - ) -> Result> { + ) -> anyhow::Result> { ::remove(self, package, path).await } @@ -262,7 +261,7 @@ impl DownloaderInterface for PerforceDownloader { package: PackageInterfaceHandle, path: &str, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { ::cleanup(self, r#type, package, path, prev_package).await } } -- cgit v1.3.1