Commit Graph

11 Commits

Author SHA1 Message Date
glitchySid
06eff6fcf8 style: Fix rustfmt formatting issues 2025-12-29 00:54:29 +05:30
glitchySid
d25dcaa0de fix: Resolve clippy warnings - allow dead code and collapse if statements 2025-12-29 00:49:53 +05:30
glitchySid
2dc269b148 ci: Add GitHub Actions workflow with clippy and fmt checks 2025-12-29 00:46:20 +05:30
glitchySid
1a72116b9d refactor: Simplify codebase by extracting modules and helpers
Extract code into focused modules for better maintainability:

New modules:
- gemini_types.rs (32 lines) - Response type definitions
- gemini_helpers.rs (51 lines) - Prompt builder and conversion helpers
- prompt.rs (130 lines) - User input and validation logic

Refactored files:
- gemini.rs: 278 -> 259 lines (-19 lines)
  * Extract response parsing into helper methods
  * Extract request building into separate methods
  * Extract retry logic into dedicated functions
  * Use PromptBuilder for cleaner prompt construction

- config.rs: 275 -> 127 lines (-148 lines)
  * Extract all prompting logic to prompt.rs module
  * Simplify with Default trait for Config
  * Cleaner API methods

Benefits:
- Better separation of concerns
- Easier to test and maintain
- Clearer module boundaries
- Reduced nesting and complexity
- All 31 tests still passing
2025-12-29 00:35:14 +05:30
glitchySid
32c1f283ac changes to gitignore 2025-12-29 00:16:48 +05:30
glitchySid
3cdcd33439 feat: Add comprehensive improvements - CLI, error handling, and docs
- Add CLI argument parsing with clap (dry-run, max-concurrent options)
- Replace .env configuration with interactive prompts and TOML config
- Add BaseDirs-based configuration storage in ~/.config/noentropy/
- Improve Gemini API client with configurable model and timeout
- Add concurrent processing with semaphore for rate limiting
- Improve error handling with retry logic and exponential backoff
- Add comprehensive README with installation and usage instructions
- Add config.example.toml template for users
- Update main.rs with better UX and colored output
- Add lib.rs exports for config module
- Refactor error response parsing for cleaner code
- Update API endpoint to use configurable model parameter
- Add proper error type handling in gemini_errors.rs
2025-12-29 00:11:27 +05:30
glitchySid
bbf88fc4fc refactor: Separate tests into dedicated files to reduce source file sizes
- Extract all tests from cache.rs, files.rs, config.rs to separate test files
- Create cache_tests.rs, files_tests.rs, config_tests.rs
- Reduce cache.rs: 421 -> 220 lines (-191 lines)
- Reduce files.rs: 390 -> 264 lines (-126 lines)
- Reduce config.rs: 354 -> 275 lines (-79 lines)
- Total reduction: 396 lines from main source files
- All 31 tests still passing
2025-12-29 00:05:08 +05:30
glitchySid
a9dbaf36be test: Add comprehensive test suite for basic functionality
- Add 31 tests across files, config, and cache modules
- Test file operations (FileBatch, is_text_file, read_file_sample)
- Test configuration (serialization, API key validation, path expansion)
- Test caching (response retrieval, file change detection, eviction)
- Add tempfile dev dependency for test fixtures
- All tests passing with 100% success rate
2025-12-28 23:58:40 +05:30
glitchySid
868ef57498 fix: Add Windows compatibility for file operations
- Fix home directory detection using BaseDirs from directories crate
- Add cross-platform file moving with copy+delete fallback
- Replace Unix-specific HOME env var usage
- Handle cross-filesystem moves on Windows automatically
2025-12-28 23:54:53 +05:30
glitchySid
5a92ecdeb7 feat: Add comprehensive improvements - async optimization, caching, and error handling
- Add async optimization using futures for concurrent file processing
- Implement intelligent caching system with SHA256 file change detection
- Add comprehensive custom error handling for Gemini API responses
- Fix critical error handling issues throughout the codebase
- Replace fragile JSON parsing with proper struct-based deserialization
- Add automatic retry logic for rate limits and network issues
- Improve user experience with detailed error messages and progress feedback
- Add cache persistence and automatic cleanup of old entries
- Optimize performance for batch processing scenarios
2025-12-28 19:15:53 +05:30
glitchySid
3c038e3a3c first commit
a tool that automatically organize your messy folders
2025-12-20 15:32:38 +05:30