Skip to content

Commit 2d73408

Browse files
authored
Refactor codebase for improved readability and maintainability (#203)
2 parents 85140f5 + 72df4ee commit 2d73408

File tree

102 files changed

+9251
-7570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+9251
-7570
lines changed

AGENTS.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22

33
This file provides guidance to agents when working with code in this repository.
44

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+
```

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## v1.7.0-alpha
5+
# CHANGES
6+
This release refactors the codebase for improved code readability, maintainability and performance.
7+
8+
- Removed size verification logic which it was not best practice to verify app integrity.
9+
410
## v1.6.0-alpha
511
# BREAKING CHANGES
612
This release introduces a comprehensive caching mechanism for GitHub release data, enhancing performance and reducing redundant API calls. The caching system is designed to store release information persistently, with a configurable time-to-live (TTL) to ensure data freshness. Additionally, the release includes significant improvements to the logging capabilities of the verification service, providing detailed insights into the verification process and asset handling.

docs/developers.md

Lines changed: 638 additions & 592 deletions
Large diffs are not rendered by default.

docs/diagram.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/refactor.md

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)