aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/init_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
committernsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
commit9be0f98f71fe8071ab839ac1036b4064ac3172b4 (patch)
tree66a2f4feba752f4761c40449e0827ad74fc9b02c /crates/shirabe/src/command/init_command.rs
parenta84d531548efa678d4021cea891826e59f8fb462 (diff)
downloadphp-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/init_command.rs')
-rw-r--r--crates/shirabe/src/command/init_command.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs
index dc91069..856cc78 100644
--- a/crates/shirabe/src/command/init_command.rs
+++ b/crates/shirabe/src/command/init_command.rs
@@ -17,7 +17,6 @@ use crate::repository::RepositoryFactory;
use crate::util::Filesystem;
use crate::util::ProcessExecutor;
use crate::util::Silencer;
-use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
use shirabe_external_packages::symfony::console::command::command::Command;
@@ -918,7 +917,10 @@ impl BaseCommand for InitCommand {
impl InitCommand {
/// @return array{name: string, email: string|null}
- fn parse_author_string(&self, author: &str) -> Result<IndexMap<String, Option<String>>> {
+ fn parse_author_string(
+ &self,
+ author: &str,
+ ) -> anyhow::Result<IndexMap<String, Option<String>>> {
let mut m: IndexMap<CaptureKey, String> = IndexMap::new();
if Preg::is_match3(
r#"/^(?P<name>[- .,\p{L}\p{N}\p{Mn}\'’\"()]+)(?:\s+<(?P<email>.+?)>)?$/u"#,
@@ -960,7 +962,10 @@ impl InitCommand {
}
/// @return array<int, array{name: string, email?: string}>
- pub(crate) fn format_authors(&self, author: &str) -> Result<Vec<IndexMap<String, PhpMixed>>> {
+ pub(crate) fn format_authors(
+ &self,
+ author: &str,
+ ) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
let parsed = self.parse_author_string(author)?;
let mut author_map: IndexMap<String, PhpMixed> = IndexMap::new();
let name = parsed.get("name").cloned().unwrap_or(None);
@@ -1072,12 +1077,18 @@ impl InitCommand {
}
/// For testing only: invoke the private `parse_author_string`.
- pub fn __parse_author_string(&self, author: &str) -> Result<IndexMap<String, Option<String>>> {
+ pub fn __parse_author_string(
+ &self,
+ author: &str,
+ ) -> anyhow::Result<IndexMap<String, Option<String>>> {
self.parse_author_string(author)
}
/// For testing only: invoke the crate-private `format_authors`.
- pub fn __format_authors(&self, author: &str) -> Result<Vec<IndexMap<String, PhpMixed>>> {
+ pub fn __format_authors(
+ &self,
+ author: &str,
+ ) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
self.format_authors(author)
}