Thanks for thinking about contributing. This project values safety, clarity, and conservative defaults — please read DESIGN_PRINCIPLES.md before opening a PR.
sudo apt install python3-gi gir1.2-gtk-3.0 python3-cairo
git clone https://github.com/codechu/disk-cleaner.git
cd disk-cleaner
pip install -e ".[dev]"
pytest -q
ruff check disk_cleaner tests- Branch names:
feature/<short>,fix/<short>,refactor/<short>,docs/<short>. - Commit messages: Conventional Commits
(
feat:,fix:,refactor:,docs:,test:,chore:). - Open a PR using the template; describe the why in the body.
pytest -qmust pass.- New feature → new test (pure logic preferred — keep UI tests minimal).
- Don't rely on the real
~/.config/disk_cleaner/; usetmp_path.
- Create
disk_cleaner/scanners/<name>.py. - Subclass
disk_cleaner.scanners.Scannerand implementlist_tasks. - Register it in
disk_cleaner/app.py(AppContextscanners dict). - Update docs/SCANNERS.md.
- Add a smoke test under
tests/.
- Create
disk_cleaner/cleaners/<name>.py, subclassCleaner. - Default to trash mode (never permanent unless explicitly opted in).
- Test on a
tmp_pathfirst; never against~.
- Create
disk_cleaner/viz/<name>.py, subclassVizStrategy. - Implement
layout,draw,hit_test. - Register the strategy in
AppContext.viz.
ruff check+ruff formatclean.- Type hints on public APIs (
from __future__ import annotations). - Use
logging.getLogger(__name__); avoidprint. - Keep PRs focused — one change, one PR.
If you find a security issue (e.g. a path-escape, an injection in a
cleaner command), don't open a public issue — email the maintainer
at the address in pyproject.toml.