aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/platform.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/util/platform.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/util/platform.rs')
-rw-r--r--crates/shirabe/src/util/platform.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/shirabe/src/util/platform.rs b/crates/shirabe/src/util/platform.rs
index b3b7e2b..45ddb30 100644
--- a/crates/shirabe/src/util/platform.rs
+++ b/crates/shirabe/src/util/platform.rs
@@ -2,7 +2,6 @@
use crate::util::ProcessExecutor;
use crate::util::Silencer;
-use anyhow::Result;
use shirabe_external_packages::composer::pcre::Preg;
use shirabe_php_shim::{
PHP_ENV, PHP_SERVER, PhpMixed, PhpResource, RuntimeException, defined, file_exists,
@@ -24,7 +23,7 @@ impl Platform {
/// getcwd() equivalent which always returns a string
///
/// @throws \RuntimeException
- pub fn get_cwd(allow_empty: bool) -> Result<String> {
+ pub fn get_cwd(allow_empty: bool) -> anyhow::Result<String> {
let mut cwd = getcwd();
// fallback to realpath('') just in case this works but odds are it would break as well if we are in a case where getcwd fails
@@ -144,7 +143,7 @@ impl Platform {
/// @throws \RuntimeException If the user home could not reliably be determined
/// @return string The formal user home as detected from environment parameters
- pub fn get_user_directory() -> Result<String> {
+ pub fn get_user_directory() -> anyhow::Result<String> {
if let Some(home) = Self::get_env("HOME") {
return Ok(home);
}
@@ -378,7 +377,7 @@ impl Platform {
if php_os_family() == "Linux" {
let mut process = ProcessExecutor::new(None);
let mut output = String::new();
- let result: Result<()> = (|| {
+ let result: anyhow::Result<()> = (|| {
if process.execute_args(&["lsmod".to_string()], &mut output, None) == 0
&& shirabe_php_shim::str_contains(&output, "vboxguest")
{