|
2 | 2 |
|
3 | 3 | This file provides guidance to agents when working with code in this repository. |
4 | 4 |
|
5 | | -- API usage is currently GitHub-only; see [`docs/developers.md`](docs/developers.md:5) for future extensibility. |
6 | | -- Catalog entries are JSON files in [`my_unicorn/catalog/`](my_unicorn/catalog/) with metadata for each app (see [`docs/wiki.md`](docs/wiki.md:276)). |
7 | | -- App-specific configs are stored in `~/.config/my-unicorn/apps/` as JSON (see [`docs/wiki.md`](docs/wiki.md:335)). |
8 | | -- Backup metadata for each app is in `~/Applications/backups/<app>/metadata.json` (see [`docs/wiki.md`](docs/wiki.md:491,505)). |
9 | | -- Batch mode and concurrency are controlled via `~/.config/my-unicorn/settings.conf` (see [`docs/wiki.md`](docs/wiki.md:218,227)). |
10 | | -- Verification requires digest/checksum fields in config/catalog; always use the public parse method for YAML/traditional formats ([`my_unicorn/services/verification_service.py`](my_unicorn/services/verification_service.py:233,263)). |
11 | | -- For verification, if no strong methods and size check fails, raise error ([`my_unicorn/services/verification_service.py`](my_unicorn/services/verification_service.py:569,643)). |
12 | | -- Always log full traceback on verification failures ([`my_unicorn/update.py`](my_unicorn/update.py:1100)). |
13 | | -- CLI commands support install via URL, catalog, update, backup, cache, config, and auth (see [`docs/wiki.md`](docs/wiki.md:41)). |
14 | | -- Manual CLI tests are run via [`scripts/test.bash`](scripts/test.bash:1); some require config files in `$HOME/.config/my-unicorn/apps/`. |
15 | | -- Code style: line length 95, indent 4 spaces, double quotes for strings ([`pyproject.toml`](pyproject.toml:111,141)). |
16 | | -- Pytest uses custom addopts and import mode: `-ra -q --strict-markers --import-mode=importlib--import-mode=importlib` ([`pyproject.toml`](pyproject.toml:67)). |
| 5 | +## General Guidelines |
| 6 | + |
| 7 | +1. Modern Python First: Use Python 3.12+ features extensively - built-in generics, pattern matching, and dataclasses. |
| 8 | +2. KISS Principle: Aim for simplicity and clarity. Avoid unnecessary abstractions or metaprogramming. |
| 9 | +3. DRY with Care: Reuse code appropriately but avoid over-engineering. Each command handler has single responsibility. |
| 10 | + |
| 11 | +## Test after any change |
| 12 | + |
| 13 | +1. Activate venv before any test execution: |
| 14 | + |
| 15 | +```bash |
| 16 | +source .venv/bin/activate |
| 17 | +``` |
| 18 | + |
| 19 | +2. Run pytest with following command to ensure all tests pass: |
| 20 | + |
| 21 | +```bash |
| 22 | +pytest -v -q --strict-markers |
| 23 | +``` |
| 24 | + |
| 25 | +## Run the application |
| 26 | + |
| 27 | +```bash |
| 28 | +python run.py --help |
| 29 | +python run.py install appflowy |
| 30 | +python run.py update appflowy |
| 31 | +``` |
0 commit comments