chore(fmt): format commands/mod.rs and commands/plugins.rs (#3174)
Co-authored-by: CodeWhale Agent <codewhale-agent@hmbown.local>
This commit is contained in:
@@ -19,8 +19,8 @@ mod jobs;
|
|||||||
mod mcp;
|
mod mcp;
|
||||||
mod memory;
|
mod memory;
|
||||||
mod network;
|
mod network;
|
||||||
mod plugins;
|
|
||||||
mod note;
|
mod note;
|
||||||
|
mod plugins;
|
||||||
mod provider;
|
mod provider;
|
||||||
mod queue;
|
mod queue;
|
||||||
mod rename;
|
mod rename;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ use std::path::PathBuf;
|
|||||||
use crate::commands::CommandResult;
|
use crate::commands::CommandResult;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::localization::{MessageId, tr};
|
use crate::localization::{MessageId, tr};
|
||||||
use crate::tui::app::App;
|
|
||||||
use crate::tools::plugin::scan_plugin_dir;
|
use crate::tools::plugin::scan_plugin_dir;
|
||||||
|
use crate::tui::app::App;
|
||||||
|
|
||||||
/// List discovered plugins, or show details for a named plugin.
|
/// List discovered plugins, or show details for a named plugin.
|
||||||
pub fn plugins(app: &mut App, arg: Option<&str>) -> CommandResult {
|
pub fn plugins(app: &mut App, arg: Option<&str>) -> CommandResult {
|
||||||
@@ -92,8 +92,7 @@ fn show_plugin_detail(
|
|||||||
));
|
));
|
||||||
out.push_str(&format!(
|
out.push_str(&format!(
|
||||||
"{}\n",
|
"{}\n",
|
||||||
tr(app.ui_locale, MessageId::CmdPluginDetailApproval)
|
tr(app.ui_locale, MessageId::CmdPluginDetailApproval).replace("{approval}", approval)
|
||||||
.replace("{approval}", approval)
|
|
||||||
));
|
));
|
||||||
out.push_str(&format!(
|
out.push_str(&format!(
|
||||||
"{}\n",
|
"{}\n",
|
||||||
@@ -115,8 +114,9 @@ fn approval_label(approval: crate::tools::spec::ApprovalRequirement) -> &'static
|
|||||||
/// Resolve the configured plugin directory, defaulting to `~/.codewhale/tools`.
|
/// Resolve the configured plugin directory, defaulting to `~/.codewhale/tools`.
|
||||||
fn plugin_dir_for(app: &App) -> Option<PathBuf> {
|
fn plugin_dir_for(app: &App) -> Option<PathBuf> {
|
||||||
let config = match &app.config_path {
|
let config = match &app.config_path {
|
||||||
Some(path) => Config::load(Some(path.clone()), app.config_profile.as_deref())
|
Some(path) => {
|
||||||
.unwrap_or_default(),
|
Config::load(Some(path.clone()), app.config_profile.as_deref()).unwrap_or_default()
|
||||||
|
}
|
||||||
None => Config::default(),
|
None => Config::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,7 +142,9 @@ mod tests {
|
|||||||
fn create_test_app_with_plugin_dir(plugin_dir: &std::path::Path) -> (App, TempDir) {
|
fn create_test_app_with_plugin_dir(plugin_dir: &std::path::Path) -> (App, TempDir) {
|
||||||
let tmp = TempDir::new().expect("tempdir");
|
let tmp = TempDir::new().expect("tempdir");
|
||||||
let config_path = tmp.path().join("config.toml");
|
let config_path = tmp.path().join("config.toml");
|
||||||
let tools_dir = plugin_dir.canonicalize().unwrap_or_else(|_| plugin_dir.to_path_buf());
|
let tools_dir = plugin_dir
|
||||||
|
.canonicalize()
|
||||||
|
.unwrap_or_else(|_| plugin_dir.to_path_buf());
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
&config_path,
|
&config_path,
|
||||||
format!(
|
format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user