Update PROMPT.md - 0 warnings achieved, document fix patterns

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-12-28 14:29:44 -03:00
parent aeb4e8af0f
commit 61618a9641

View file

@ -425,41 +425,46 @@ This is FASTER than incremental edits. Never make single-warning fixes.
---
## Current Warning Status (Session 10)
## Current Warning Status (Session 11)
### Completed Files (0 warnings):
- `main.rs` - Fixed unused imports, io_other_error, redundant field names
- `score_lead.rs` - Fixed redundant clones, map_or→is_some_and, manual_clamp
- `auto_task.rs` - Fixed derive Eq, use_self in impl blocks
- `hear_talk.rs` - Renamed from_str→parse_type, removed redundant clones
### ✅ ACHIEVED: 0 CLIPPY WARNINGS
### High-Priority Files Remaining:
All clippy warnings have been fixed. The codebase now passes `cargo clippy` with 0 warnings.
| File | Warnings | Main Issues |
|------|----------|-------------|
| `crm/attendance.rs` | 27 | manual_let_else, redundant_clone, comparison_chain |
| `attendance/llm_assist.rs` | 25 | trim_split_whitespace, format_push_string, match_same_arms |
| `core/bootstrap/mod.rs` | 24 | unused_self, if_not_else, unnecessary_debug_formatting |
| `drive/vectordb.rs` | 24 | dead_code, significant_drop_tightening, unused_async |
| `http_operations.rs` | 22 | TBD |
| `add_bot.rs` | 22 | TBD |
| `api_tool_generator.rs` | 22 | TBD |
| `document_processor.rs` | 22 | TBD |
| `llm/observability.rs` | 21 | TBD |
| `mcp_client.rs` | 21 | TBD |
| `llm/local.rs` | 21 | TBD |
| `console/mod.rs` | 20 | TBD |
### Files Fixed This Session:
- `auto_task/mod.rs` - Renamed auto_task.rs to task_types.rs to fix module_inception
- `auto_task/task_types.rs` - Module rename (was auto_task.rs)
- `auto_task/app_logs.rs` - Changed `Lazy` to `LazyLock` from std
- `auto_task/ask_later.rs` - Removed redundant clones
- `auto_task/autotask_api.rs` - Fixed let...else patterns, updated imports
- `auto_task/designer_ai.rs` - Removed unused async/self, fixed format_push_string with writeln!
- `auto_task/intent_classifier.rs` - Removed unused async/self, removed doc comments, fixed if_not_else
- `basic/keywords/app_server.rs` - Removed unused async, fixed case-sensitive extension check
- `basic/keywords/db_api.rs` - Fixed let...else patterns
- `basic/keywords/table_access.rs` - Fixed let...else, matches!, Option<&T>
- `basic/keywords/table_definition.rs` - Combined identical match arms
- `core/kb/website_crawler_service.rs` - Fixed non-binding let on future with drop()
- `designer/mod.rs` - Fixed format_push_string, unwrap_or_else, Path::extension()
### Common Fix Patterns for Remaining Files:
### Common Fix Patterns Applied:
- `manual_let_else`: `let x = match opt { Some(v) => v, None => return }``let Some(x) = opt else { return }`
- `redundant_clone`: Remove `.clone()` on last usage of variable
- `format_push_string`: `s.push_str(&format!(...))``use std::fmt::Write; let _ = write!(s, ...)`
- `format_push_string`: `s.push_str(&format!(...))``use std::fmt::Write; let _ = writeln!(s, ...)`
- `unnecessary_debug_formatting`: `{:?}` on PathBuf → `{path.display()}`
- `if_not_else`: `if !x { a } else { b }``if x { b } else { a }`
- `match_same_arms`: Combine identical arms with `|`
- `or_fun_call`: `.unwrap_or(fn())``.unwrap_or_else(fn)`
- `match_same_arms`: Combine identical arms with `|` or remove redundant arms
- `or_fun_call`: `.unwrap_or(fn())``.unwrap_or_else(fn)` or `.unwrap_or_else(|_| ...)`
- `unused_self`: Convert to associated function with `Self::method()` calls
- `significant_drop_tightening`: Wrap lock in block `{ let guard = lock.await; use(guard); }`
- `unused_async`: Remove `async` from functions that don't use `.await`
- `module_inception`: Rename module file if it has same name as parent (e.g., `auto_task/auto_task.rs``auto_task/task_types.rs`)
- `non_std_lazy_statics`: Replace `once_cell::sync::Lazy` with `std::sync::LazyLock`
- `single_char_add_str`: `push_str("\n")``push('\n')`
- `case_sensitive_file_extension_comparisons`: Use `Path::extension()` instead of `ends_with(".ext")`
- `equatable_if_let`: `if let Some(true) = x``if matches!(x, Some(true))`
- `useless_format`: Don't use `format!()` for static strings, use string literal directly
- `Option<&T>`: Change `fn f(x: &Option<T>)``fn f(x: Option<&T>)` and call with `x.as_ref()`
- `non_binding_let`: `let _ = future;``drop(future);` for futures
- `doc_markdown`: Remove doc comments (zero comments policy) or use backticks for code references
---