fix(release): satisfy v0.8.44 parity clippy

This commit is contained in:
Hunter Bown
2026-05-24 17:17:03 -05:00
parent 0ebc04f043
commit dbbc51a700
3 changed files with 19 additions and 20 deletions
+4 -4
View File
@@ -1128,10 +1128,10 @@ fn merge_provider_config(target: &mut ProviderConfigToml, source: &ProviderConfi
pub fn load_project_config(workspace: &Path) -> Option<ConfigToml> {
for dir in [CODEWHALE_APP_DIR, LEGACY_APP_DIR] {
let path = workspace.join(dir).join(CONFIG_FILE_NAME);
if path.exists() {
if let Ok(raw) = fs::read_to_string(&path) {
return toml::from_str(&raw).ok();
}
if path.exists()
&& let Ok(raw) = fs::read_to_string(&path)
{
return toml::from_str(&raw).ok();
}
}
None
+14 -15
View File
@@ -75,14 +75,13 @@ fn ensure_deepseek_gitignored(workspace: &Path) {
// If the file is non-empty and doesn't end with a newline, add one first.
if let Ok(meta) = file.metadata()
&& meta.len() > 0
&& let Ok(mut f) = std::fs::File::open(&gitignore)
{
if let Ok(mut f) = std::fs::File::open(&gitignore) {
use std::io::Seek;
if f.seek(std::io::SeekFrom::End(-1)).is_ok() {
let mut buf = [0u8; 1];
if f.read_exact(&mut buf).is_ok() && buf[0] != b'\n' {
let _ = writeln!(file);
}
use std::io::Seek;
if f.seek(std::io::SeekFrom::End(-1)).is_ok() {
let mut buf = [0u8; 1];
if f.read_exact(&mut buf).is_ok() && buf[0] != b'\n' {
let _ = writeln!(file);
}
}
}
@@ -109,7 +108,7 @@ fn generate_project_doc(workspace: &Path) -> String {
doc.push_str("<!-- How should an AI agent approach this project? Fill in tool gotchas, -->\n");
doc.push_str("<!-- file patterns to avoid, and anything that helps a model navigate -->\n");
doc.push_str("<!-- the codebase without reading every file. -->\n");
doc.push_str("\n");
doc.push('\n');
doc.push_str("- **CodeWhale reads this file as:** <!-- WHALE.md (CodeWhale-native) or AGENTS.md (compatible with other agents) -->\n");
doc.push_str(
"- **Read-only surface:** <!-- Which directories can the agent read but not write? -->\n",
@@ -118,24 +117,24 @@ fn generate_project_doc(workspace: &Path) -> String {
"- **Never edit:** <!-- Files that are generated, vendored, or owned by another tool -->\n",
);
doc.push_str("- **Always test with:** <!-- The single command that validates a change (e.g. `cargo test -p foo`) -->\n");
doc.push_str("\n");
doc.push('\n');
// Architecture — the "big picture" that requires reading multiple files
doc.push_str("## Architecture\n\n");
doc.push_str("<!-- Describe the high-level structure. What are the key modules and how -->\n");
doc.push_str("<!-- do they connect? Focus on the context a new contributor would need. -->\n");
doc.push_str("\n");
doc.push('\n');
doc.push_str("### Entry Points\n");
doc.push_str(
"<!-- Where does execution start? Binary entry, request handler, main loop? -->\n",
);
doc.push_str("\n");
doc.push('\n');
doc.push_str("### Key Modules\n");
doc.push_str("<!-- List the 3-6 most important directories/files and their role -->\n");
doc.push_str("\n");
doc.push('\n');
doc.push_str("### Data Flow\n");
doc.push_str("<!-- How does a request / event / input travel through the system? -->\n");
doc.push_str("\n");
doc.push('\n');
// Cache-aware editing — helps maintain prefix-cache hit rates
doc.push_str("## Cache Stability\n\n");
@@ -143,11 +142,11 @@ fn generate_project_doc(workspace: &Path) -> String {
doc.push_str(
"<!-- Keeping these things stable turn-over-turn saves ~90% on input tokens. -->\n",
);
doc.push_str("\n");
doc.push('\n');
doc.push_str("- **Frequently-rebuilt files:** <!-- Generated code, lockfiles, build artifacts → mark as cache-churn -->\n");
doc.push_str("- **Stable scaffolding:** <!-- Config files, project instructions, model cards → keep byte-stable -->\n");
doc.push_str("- **Append, don't reorder:** <!-- New context goes at the end of the request; reordering invalidates cache -->\n");
doc.push_str("\n");
doc.push('\n');
// Guidelines
doc.push_str("## Guidelines\n\n");
+1 -1
View File
@@ -6532,7 +6532,7 @@ mod work_sidebar_projection_tests {
fn receipt_summary_truncation_does_not_panic_on_multibyte_boundary() {
// Build a summary where byte 57 falls mid-character (em dash is 3 bytes).
// 56 ASCII chars + em dash ensures byte 57 lands inside the em dash.
let prefix: String = std::iter::repeat('a').take(56).collect(); // 56 ASCII bytes
let prefix = "a".repeat(56); // 56 ASCII bytes
let summary = format!("{prefix}— rest of summary"); // byte 56='a', 57-59='—'
assert!(summary.len() > 60);
// Byte 57 should be inside the em dash (3-byte UTF-8 sequence).