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/dependency_resolver/rule.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/rule.rs') diff --git a/crates/shirabe/src/dependency_resolver/rule.rs b/crates/shirabe/src/dependency_resolver/rule.rs index 958af5a..ab4eeb0 100644 --- a/crates/shirabe/src/dependency_resolver/rule.rs +++ b/crates/shirabe/src/dependency_resolver/rule.rs @@ -12,7 +12,6 @@ use crate::package::version::VersionParser; use crate::repository::PlatformRepository; use crate::repository::RepositoryInterface; use crate::repository::RepositorySet; -use anyhow::Result; use indexmap::IndexMap; use shirabe_php_shim::{ LogicException, PhpMixed, RuntimeException, array_keys, array_shift, implode, @@ -97,7 +96,7 @@ impl Rule { } } - pub fn get_hash(&self) -> Result { + pub fn get_hash(&self) -> anyhow::Result { match self { Rule::Generic(r) => Ok(PhpMixed::Int(r.get_hash()?)), Rule::MultiConflict(r) => Ok(PhpMixed::Int(r.get_hash()?)), @@ -170,7 +169,7 @@ impl Rule { (self.bitfield() & (255 << BITFIELD_TYPE)) >> BITFIELD_TYPE } - pub fn disable(&mut self) -> Result<()> { + pub fn disable(&mut self) -> anyhow::Result<()> { if let Rule::MultiConflict(_) = self { return Err(RuntimeException { message: "Disabling multi conflict rules is not possible. Please contact composer at https://github.com/composer/composer to let us debug what lead to this situation.".to_string(), @@ -278,7 +277,7 @@ impl Rule { } /// @internal - pub fn get_source_package(&self, pool: &Pool) -> Result { + pub fn get_source_package(&self, pool: &Pool) -> anyhow::Result { let literals = self.get_literals(); match self.get_reason() { -- cgit v1.3.1