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/repository/vcs/forgejo_driver.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/repository/vcs/forgejo_driver.rs')
| -rw-r--r-- | crates/shirabe/src/repository/vcs/forgejo_driver.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs index 9557847..764a2d2 100644 --- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs +++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs @@ -14,7 +14,6 @@ use crate::util::Forgejo; use crate::util::ForgejoRepositoryData; use crate::util::ForgejoUrl; use crate::util::http::Response; -use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ @@ -49,7 +48,7 @@ impl ForgejoDriver { } } - pub fn initialize(&mut self) -> Result<()> { + pub fn initialize(&mut self) -> anyhow::Result<()> { let forgejo_url = ForgejoUrl::create(&self.inner.url)?; self.inner.origin_url = forgejo_url.origin_url.clone(); @@ -90,7 +89,11 @@ impl ForgejoDriver { Ok(()) } - pub fn get_file_content(&mut self, file: &str, identifier: &str) -> Result<Option<String>> { + pub fn get_file_content( + &mut self, + file: &str, + identifier: &str, + ) -> anyhow::Result<Option<String>> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_file_content(file, identifier); } @@ -177,7 +180,7 @@ impl ForgejoDriver { pub fn get_change_date( &mut self, identifier: &str, - ) -> Result<Option<chrono::DateTime<chrono::FixedOffset>>> { + ) -> anyhow::Result<Option<chrono::DateTime<chrono::FixedOffset>>> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_change_date(identifier); } @@ -214,7 +217,7 @@ impl ForgejoDriver { Ok(Some(date)) } - pub fn get_root_identifier(&mut self) -> Result<String> { + pub fn get_root_identifier(&mut self) -> anyhow::Result<String> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_root_identifier(); } @@ -227,7 +230,7 @@ impl ForgejoDriver { .clone()) } - pub fn get_branches(&mut self) -> Result<IndexMap<String, String>> { + pub fn get_branches(&mut self) -> anyhow::Result<IndexMap<String, String>> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_branches(); } @@ -270,7 +273,7 @@ impl ForgejoDriver { Ok(self.branches.clone().unwrap_or_default()) } - pub fn get_tags(&mut self) -> Result<IndexMap<String, String>> { + pub fn get_tags(&mut self) -> anyhow::Result<IndexMap<String, String>> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_tags(); } @@ -330,7 +333,7 @@ impl ForgejoDriver { pub fn get_composer_information( &mut self, identifier: &str, - ) -> Result<Option<IndexMap<String, PhpMixed>>> { + ) -> anyhow::Result<Option<IndexMap<String, PhpMixed>>> { if let Some(ref mut git_driver) = self.git_driver { return git_driver.get_composer_information(identifier); } @@ -526,7 +529,7 @@ impl ForgejoDriver { Ok(true) } - fn setup_git_driver(&mut self, url: &str) -> Result<()> { + fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> { let mut git_driver = GitDriver { inner: VcsDriverBase::new( { @@ -549,7 +552,7 @@ impl ForgejoDriver { Ok(()) } - fn fetch_repository_data(&mut self) -> Result<()> { + fn fetch_repository_data(&mut self) -> anyhow::Result<()> { if self.repository_data.is_some() { return Ok(()); } |
