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/installer/plugin_installer.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/installer/plugin_installer.rs') diff --git a/crates/shirabe/src/installer/plugin_installer.rs b/crates/shirabe/src/installer/plugin_installer.rs index 28e4e0d..132d408 100644 --- a/crates/shirabe/src/installer/plugin_installer.rs +++ b/crates/shirabe/src/installer/plugin_installer.rs @@ -11,7 +11,6 @@ use crate::plugin::PluginManager; use crate::repository::InstalledRepositoryInterface; use crate::util::Filesystem; use crate::util::Platform; -use anyhow::Result; use shirabe_php_shim::{PhpMixed, UnexpectedValueException, empty}; #[derive(Debug)] @@ -49,7 +48,7 @@ impl PluginInstaller { e: anyhow::Error, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result<()> { + ) -> anyhow::Result<()> { self.inner.io.write_error(&format!( "Plugin initialization failed ({}), uninstalling plugin", e @@ -83,7 +82,7 @@ impl InstallerInterface for PluginInstaller { r#type: &str, package: PackageInterfaceHandle, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { if (r#type == "install" || r#type == "update") && !self .get_plugin_manager() @@ -110,7 +109,7 @@ impl InstallerInterface for PluginInstaller { &mut self, package: PackageInterfaceHandle, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { let extra = package.get_extra(); let class = extra.get("class").cloned().unwrap_or(PhpMixed::Null); if empty(&class) { @@ -130,7 +129,7 @@ impl InstallerInterface for PluginInstaller { &mut self, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result> { + ) -> anyhow::Result> { self.inner.install(repo, package).await?; // TODO(plugin): register package in plugin manager after install, rollback on failure @@ -145,7 +144,7 @@ impl InstallerInterface for PluginInstaller { repo: &mut dyn InstalledRepositoryInterface, initial: PackageInterfaceHandle, target: PackageInterfaceHandle, - ) -> Result> { + ) -> anyhow::Result> { self.inner.update(repo, initial, target).await?; // TODO(plugin): deactivate initial and register target in plugin manager after update, rollback on failure @@ -160,7 +159,7 @@ impl InstallerInterface for PluginInstaller { &mut self, repo: &mut dyn InstalledRepositoryInterface, package: PackageInterfaceHandle, - ) -> Result> { + ) -> anyhow::Result> { // TODO(plugin): uninstall package from plugin manager self.get_plugin_manager() .borrow_mut() @@ -174,7 +173,7 @@ impl InstallerInterface for PluginInstaller { r#type: &str, package: PackageInterfaceHandle, prev_package: Option, - ) -> Result> { + ) -> anyhow::Result> { self.inner.cleanup(r#type, package, prev_package).await } -- cgit v1.3.1