Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 1.71 KB

File metadata and controls

65 lines (48 loc) · 1.71 KB

Storage Analyzer - Development Guide

Project Structure

storage_analyzer/
├── storage_analyzer/
│   ├── __init__.py
│   ├── main.py          # CLI entry point (Click + Rich)
│   ├── scanner.py       # Directory traversal
│   ├── analyzer.py      # Size calculation
│   ├── suggestions.py   # Cleanup recommendations
│   └── utils.py         # Helpers (size formatting, etc.)
├── tests/
│   ├── test_scanner.py
│   ├── test_analyzer.py
│   ├── test_suggestions.py
│   ├── test_utils.py
│   └── test_main.py
├── pyproject.toml
└── README.md

Running Tests

python3 -m pytest tests/ -v

Adding New Cleanable Items

To add new cleanable items detection:

  1. Edit storage_analyzer/suggestions.py
  2. Add the path to cleanable_paths list in get_user_cleanable_items()
  3. Follow the pattern: (relative_path, name, command)
  4. Add tests in tests/test_suggestions.py

Adding New CLI Commands

To add new commands:

  1. Edit storage_analyzer/main.py
  2. Add new function with @cli.command() decorator
  3. Use Rich tables and panels for output
  4. Add tests in tests/test_main.py

Releasing

To trigger the build workflow and create GitHub Releases:

git tag v<version> && git push --tags

The workflow builds standalone executables for Linux, Windows, and macOS, then creates a GitHub Release with the artifacts.

Self-reminder: When significant features or fixes are complete, create and push a version tag to trigger builds and release.

Code Style

  • Use type hints
  • Add docstrings to public functions
  • Keep functions small and focused
  • Always write tests for new features