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
python3 -m pytest tests/ -vTo add new cleanable items detection:
- Edit
storage_analyzer/suggestions.py - Add the path to
cleanable_pathslist inget_user_cleanable_items() - Follow the pattern:
(relative_path, name, command) - Add tests in
tests/test_suggestions.py
To add new commands:
- Edit
storage_analyzer/main.py - Add new function with
@cli.command()decorator - Use Rich tables and panels for output
- Add tests in
tests/test_main.py
To trigger the build workflow and create GitHub Releases:
git tag v<version> && git push --tagsThe 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.
- Use type hints
- Add docstrings to public functions
- Keep functions small and focused
- Always write tests for new features