diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-29 00:03:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-29 00:03:00 +0900 |
| commit | 9be0f98f71fe8071ab839ac1036b4064ac3172b4 (patch) | |
| tree | 66a2f4feba752f4761c40449e0827ad74fc9b02c /crates/shirabe/src/command/package_discovery_trait.rs | |
| parent | a84d531548efa678d4021cea891826e59f8fb462 (diff) | |
| download | php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.gz php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.zst php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/package_discovery_trait.rs')
| -rw-r--r-- | crates/shirabe/src/command/package_discovery_trait.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs index c3f744c..475b67d 100644 --- a/crates/shirabe/src/command/package_discovery_trait.rs +++ b/crates/shirabe/src/command/package_discovery_trait.rs @@ -17,7 +17,6 @@ use crate::repository::RepositoryFactory; use crate::repository::RepositorySet; use crate::repository::{RepositoryInterface, SearchResult}; use crate::util::Filesystem; -use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_external_packages::symfony::console::input::InputInterface; @@ -104,7 +103,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { &input .borrow() .get_option("stability") - .expect("get_minimum_stability returns String, not Result; stability option is guaranteed present by the has_option guard above") + .expect("get_minimum_stability returns String, not anyhow::Result; stability option is guaranteed present by the has_option guard above") .as_string() .map(|s| s.to_string()) .unwrap_or_else(|| "stable".to_string()), @@ -139,7 +138,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { preferred_stability: &str, use_best_version_constraint: bool, fixed: bool, - ) -> Result<Vec<String>> { + ) -> anyhow::Result<Vec<String>> { if !requires.is_empty() { let requires_norm = self.normalize_requirements(requires.clone())?; let mut result: Vec<String> = vec![]; @@ -462,7 +461,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { platform_repo: Option<&PlatformRepositoryHandle>, preferred_stability: &str, fixed: bool, - ) -> Result<(String, String)> { + ) -> anyhow::Result<(String, String)> { // handle ignore-platform-reqs flag if present let platform_requirement_filter = if input.borrow().has_option("ignore-platform-reqs") && input.borrow().has_option("ignore-platform-req") @@ -751,8 +750,8 @@ pub trait PackageDiscoveryTrait: BaseCommand { } /// @return array<string> - fn find_similar(&self, package: &str) -> Result<Vec<String>> { - let results: Vec<SearchResult> = match (|| -> Result<Vec<SearchResult>> { + fn find_similar(&self, package: &str) -> anyhow::Result<Vec<String>> { + let results: Vec<SearchResult> = match (|| -> anyhow::Result<Vec<SearchResult>> { if self.get_repos_mut().is_none() { return Err(LogicException { message: "findSimilar was called before $this->repos was initialized" |
