diff --git a/Cargo.toml b/Cargo.toml index a49b73dd..b36267b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ license = "Apache-2.0" repository = "https://github.com/block/goose" description = "An AI agent" +[workspace.lints.clippy] +uninlined_format_args = "allow" + # Patch for Windows cross-compilation issue with crunchy [patch.crates-io] crunchy = { git = "https://github.com/nmathewson/crunchy", branch = "cross-compilation-fix" } \ No newline at end of file diff --git a/crates/goose-bench/Cargo.toml b/crates/goose-bench/Cargo.toml index 6c98c99b..ba436de5 100644 --- a/crates/goose-bench/Cargo.toml +++ b/crates/goose-bench/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [dependencies] anyhow = "1.0" diff --git a/crates/goose-cli/Cargo.toml b/crates/goose-cli/Cargo.toml index 5e891508..da00f89e 100644 --- a/crates/goose-cli/Cargo.toml +++ b/crates/goose-cli/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [[bin]] name = "goose" path = "src/main.rs" diff --git a/crates/goose-ffi/Cargo.toml b/crates/goose-ffi/Cargo.toml index 4c6f1f60..f5e430f6 100644 --- a/crates/goose-ffi/Cargo.toml +++ b/crates/goose-ffi/Cargo.toml @@ -8,6 +8,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [lib] name = "goose_ffi" crate-type = ["cdylib"] diff --git a/crates/goose-llm/Cargo.toml b/crates/goose-llm/Cargo.toml index be240600..17723e31 100644 --- a/crates/goose-llm/Cargo.toml +++ b/crates/goose-llm/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [lib] crate-type = ["lib", "cdylib"] name = "goose_llm" diff --git a/crates/goose-mcp/Cargo.toml b/crates/goose-mcp/Cargo.toml index 83ab4ef3..b6b77d01 100644 --- a/crates/goose-mcp/Cargo.toml +++ b/crates/goose-mcp/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [dependencies] mcp-core = { path = "../mcp-core" } mcp-server = { path = "../mcp-server" } diff --git a/crates/goose-server/Cargo.toml b/crates/goose-server/Cargo.toml index a343ce5a..bc5b384e 100644 --- a/crates/goose-server/Cargo.toml +++ b/crates/goose-server/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [dependencies] goose = { path = "../goose" } mcp-core = { path = "../mcp-core" } diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml index c435449a..2467e559 100644 --- a/crates/goose/Cargo.toml +++ b/crates/goose/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true description.workspace = true +[lints] +workspace = true + [build-dependencies] tokio = { version = "1.43", features = ["full"] } reqwest = { version = "0.12.9", features = ["json", "rustls-tls-native-roots"], default-features = false } diff --git a/crates/goose/build.rs b/crates/goose/build.rs index 1c99b236..1d924266 100644 --- a/crates/goose/build.rs +++ b/crates/goose/build.rs @@ -10,7 +10,7 @@ async fn main() -> Result<(), Box> { // Create base directory fs::create_dir_all(BASE_DIR)?; println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rerun-if-changed={}", BASE_DIR); + println!("cargo:rerun-if-changed={BASE_DIR}"); for tokenizer_name in TOKENIZERS { download_tokenizer(tokenizer_name).await?; @@ -21,30 +21,26 @@ async fn main() -> Result<(), Box> { async fn download_tokenizer(repo_id: &str) -> Result<(), Box> { let dir_name = repo_id.replace('/', "--"); - let download_dir = format!("{}/{}", BASE_DIR, dir_name); - let file_url = format!( - "https://huggingface.co/{}/resolve/main/tokenizer.json", - repo_id - ); - let file_path = format!("{}/tokenizer.json", download_dir); + let download_dir = format!("{BASE_DIR}/{dir_name}"); + let file_url = format!("https://huggingface.co/{repo_id}/resolve/main/tokenizer.json"); + let file_path = format!("{download_dir}/tokenizer.json"); // Create directory if it doesn't exist fs::create_dir_all(&download_dir)?; // Check if file already exists if Path::new(&file_path).exists() { - println!("Tokenizer for {} already exists, skipping...", repo_id); + println!("Tokenizer for {repo_id} already exists, skipping..."); return Ok(()); } - println!("Downloading tokenizer for {}...", repo_id); + println!("Downloading tokenizer for {repo_id}..."); // Download the file let response = reqwest::get(&file_url).await?; if !response.status().is_success() { return Err(format!( - "Failed to download tokenizer for {}, status: {}", - repo_id, + "Failed to download tokenizer for {repo_id}, status: {}", response.status() ) .into()); @@ -53,6 +49,6 @@ async fn download_tokenizer(repo_id: &str) -> Result<(), Box> { let content = response.bytes().await?; fs::write(&file_path, content)?; - println!("Downloaded {} to {}", repo_id, file_path); + println!("Downloaded {repo_id} to {file_path}"); Ok(()) } diff --git a/crates/mcp-client/Cargo.toml b/crates/mcp-client/Cargo.toml index 914fd31d..95b6728f 100644 --- a/crates/mcp-client/Cargo.toml +++ b/crates/mcp-client/Cargo.toml @@ -3,6 +3,9 @@ name = "mcp-client" version = "0.1.0" edition = "2021" +[lints] +workspace = true + [dependencies] mcp-core = { path = "../mcp-core" } tokio = { version = "1", features = ["full"] } diff --git a/crates/mcp-client/src/transport/stdio.rs b/crates/mcp-client/src/transport/stdio.rs index 0b3a44ca..2489af1b 100644 --- a/crates/mcp-client/src/transport/stdio.rs +++ b/crates/mcp-client/src/transport/stdio.rs @@ -134,10 +134,7 @@ impl StdioActor { while let Some(message_str) = receiver.recv().await { tracing::debug!(message = ?message_str, "Sending outgoing message"); - if let Err(e) = stdin - .write_all(format!("{}\n", message_str).as_bytes()) - .await - { + if let Err(e) = stdin.write_all(format!("{message_str}\n").as_bytes()).await { tracing::error!(error = ?e, "Error writing message to child process"); break; } diff --git a/crates/mcp-core/Cargo.toml b/crates/mcp-core/Cargo.toml index 2e7d4cc6..4f470798 100644 --- a/crates/mcp-core/Cargo.toml +++ b/crates/mcp-core/Cargo.toml @@ -3,6 +3,9 @@ name = "mcp-core" version = "0.1.0" edition = "2021" +[lints] +workspace = true + [dependencies] async-trait = "0.1" serde = { version = "1.0", features = ["derive"] } diff --git a/crates/mcp-macros/Cargo.toml b/crates/mcp-macros/Cargo.toml index c9f1d3e9..0b5903a6 100644 --- a/crates/mcp-macros/Cargo.toml +++ b/crates/mcp-macros/Cargo.toml @@ -3,6 +3,9 @@ name = "mcp-macros" version = "0.1.0" edition = "2021" +[lints] +workspace = true + [lib] proc-macro = true diff --git a/crates/mcp-server/Cargo.toml b/crates/mcp-server/Cargo.toml index 3657fc58..fbaf90ba 100644 --- a/crates/mcp-server/Cargo.toml +++ b/crates/mcp-server/Cargo.toml @@ -3,6 +3,9 @@ name = "mcp-server" version = "0.1.0" edition = "2021" +[lints] +workspace = true + [dependencies] anyhow = "1.0.94" thiserror = "1.0"