You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: comprehensive cleanup and interface improvements
This commit performs a comprehensive cleanup of deprecated/unused code and improves the Tool interface design:
**Removed Deprecated/Unused Code:**
- Removed deprecated InstallTool(), InstallTools(), InstallToolsParallel(), InstallToolsWithOptions() methods
- Removed unused InstallOptions struct (replaced with EnsureTools/EnsureTool)
- Removed redundant Name() methods from all tools (consolidated on GetToolName())
- Removed deprecated Pre/Post hook fields from CommandConfig (part of removed built-in command system)
- Removed unused ClearAllCaches(), ClearPathCache() methods and CacheManager interface
- Updated all callers to use EnsureTools/EnsureTool instead of deprecated methods
**Enhanced GetChecksum Interface:**
- Updated GetChecksum signature from (version, filename) to (version, cfg, filename)
- Provides tools access to full ToolConfig including distribution info and options
- Enables more efficient and context-aware checksum fetching
- Updated all tool implementations: JavaTool, GoTool, NodeTool, MavenTool, MvndTool
- Updated call sites in download.go and tests
**Removed Unused Internal Methods:**
- Removed getChecksumURL() from JavaTool, GoTool, NodeTool (not used)
- Removed getVersionsURL() from all tools (not used anywhere)
- Only kept getChecksumURL() in MavenTool and MvndTool where actually used
**Interface Simplification:**
- Eliminated entire ToolMetadataProvider interface
- Moved GetDisplayName() into main Tool interface
- Removed GetEmoji() method entirely (using default emoji in display code)
- Made GetChecksumURL() and GetVersionsURL() private implementation details
**Java Checksum Architecture Clarification:**
- Java checksums are handled during installation via getDownloadURLWithChecksum()
- GetChecksum() method returns informative error since checksums are pre-fetched
- Maintains existing efficient integration with Disco API during URL resolution
**Benefits:**
- Cleaner Tool interface with only necessary public methods
- Removed 243+ lines of deprecated/unused code
- More consistent and extensible GetChecksum signature
- Better separation of concerns between installation-time and on-demand checksum fetching
- Improved maintainability by eliminating dead code
- Follows SOLID principles with focused interfaces
All tests pass and functionality is preserved while significantly reducing code complexity.
0 commit comments