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/platform/runtime.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/shirabe/src/platform/runtime.rs') diff --git a/crates/shirabe/src/platform/runtime.rs b/crates/shirabe/src/platform/runtime.rs index fcee930..255aa9d 100644 --- a/crates/shirabe/src/platform/runtime.rs +++ b/crates/shirabe/src/platform/runtime.rs @@ -1,6 +1,5 @@ //! ref: composer/src/Composer/Platform/Runtime.php -use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ @@ -19,10 +18,10 @@ pub trait RuntimeInterface: std::fmt::Debug { /// `[class, method]` list), matching PHP `invoke($callable, $arguments)`. fn invoke(&self, callable: PhpMixed, arguments: Vec) -> PhpMixed; fn has_class(&self, class: &str) -> bool; - fn construct(&self, class: &str, arguments: Vec) -> Result; + fn construct(&self, class: &str, arguments: Vec) -> anyhow::Result; fn get_extensions(&self) -> Vec; fn get_extension_version(&self, extension: &str) -> String; - fn get_extension_info(&self, extension: &str) -> Result; + fn get_extension_info(&self, extension: &str) -> anyhow::Result; } #[derive(Debug)] @@ -54,7 +53,7 @@ impl RuntimeInterface for Runtime { class_exists(class) } - fn construct(&self, class: &str, arguments: Vec) -> Result { + fn construct(&self, class: &str, arguments: Vec) -> anyhow::Result { if arguments.is_empty() { Ok(instantiate_class(class, vec![])) } else { @@ -71,7 +70,7 @@ impl RuntimeInterface for Runtime { version.unwrap_or_else(|| "0".to_string()) } - fn get_extension_info(&self, extension: &str) -> Result { + fn get_extension_info(&self, extension: &str) -> anyhow::Result { // Depends on \ReflectionExtension::info() and output buffering; no shim equivalent exists. let _ = extension; todo!() -- cgit v1.3.1