Skip to content

Conversation

@AlexMikhalev
Copy link
Contributor

This PR fixes all clippy warnings that were causing CI failures in PR #494.

Changes:

  1. Fix needless_borrows_for_generic_args in terraphim_update (4 instances)

    • Changed &format!() to format!() in bin_install_path() calls
    • This removes unnecessary borrowing when passing to generic functions
  2. Fix unnecessary_unwrap in terraphim-session-analyzer tests

    • Changed if file_op.agent_context.is_some() check to if let Some(agent_context) = &file_op.agent_context
    • Eliminates unnecessary .as_ref().unwrap() call
  3. Fix needless_question_mark in terraphim_agent repl/mcp_tools (2 instances)

    • Removed redundant Ok() wrapping around async calls
    • Both extract_paragraphs() and replace_matches() methods now directly return Results
  4. Fix wildcard_in_or_patterns in terraphim_agent repl/mcp_tools (1 instance)

    • Changed Some("markdown") | _ to Some("markdown") | None pattern
    • Properly handles the wildcard case separately
  5. **Add `#[allow(dead_code)]`` for McpToolsHandler

    • The repl-mcp feature is not currently used, marking as allowed until needed
  6. Remove deprecated rocksdb feature tests

    • Removed test_save_and_load_rocksdb() from settings.rs (88 lines)
    • Removed test_save_and_load_thesaurus_rocksdb() from thesaurus.rs (69 lines)
    • RocksDB feature was disabled due to locking issues
    • These tests were causing unexpected_cfgs clippy errors

Impact:

  • All clippy checks now pass with -D warnings
  • CI should now pass for rust-clippy job
  • No functional changes, only code quality improvements

Testing:

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo fmt --all -- --check passes

- Add --tui flag to force TUI mode
- REPL is now default when running terraphim-agent without arguments
- TUI mode requires a server to be running at localhost:8000
- Update help text to reflect new default behavior
- All tests passing
- Fix needless_borrows_for_generic_args in terraphim_update (4 instances)
- Fix unnecessary_unwrap in terraphim-session-analyzer tests
- Fix needless_question_mark in terraphim_agent repl/mcp_tools
- Fix wildcard_in_or_patterns in terraphim_agent repl/mcp_tools
- Add #[allow(dead_code)] for McpToolsHandler (feature not used)
- Remove deprecated rocksdb feature tests (causing unexpected_cfgs errors)
- All clippy checks now pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants