Contributing¶
Development setup¶
Clone the repository and install all dependency groups (including dev and docs):
git clone https://codeberg.org/MarvinsMastodonTools/taibai.git
cd taibai
uv sync --all-groups
source .venv/bin/activate
Running checks¶
The project enforces five quality gates. Every change must pass all five before it is considered complete.
Format¶
Lint¶
Type check¶
Complexity¶
No function may exceed the configured complexity threshold.
Tests¶
Run the full CI suite at once:
Test-driven development¶
taibai uses red/green TDD:
- Write a failing test that captures the intended behaviour.
- Make the minimal code change to make it pass.
- Refactor as needed, keeping tests green.
Every new feature or bug fix must be accompanied by tests. Tests live in tests/ and use
pytest-httpx to mock HTTP calls — no real network requests are made in the test suite.
Commit style¶
Commits follow Conventional Commits with short Commitizen-style messages:
Common types: feat, fix, refactor, docs, test, chore.
Always append the co-author trailer:
Off-limits files¶
The following files are maintained exclusively by the project maintainer and must not be edited in contributions:
ruff.tomlnoxfile.pycliff.tomlCHANGELOG.md
Release process¶
Releases are cut by the maintainer using:
just release patch # 0.2.0 → 0.2.1
just release minor # 0.2.0 → 0.3.0
just release major # 0.2.0 → 1.0.0
Do not manually edit CHANGELOG.md or the version field in pyproject.toml.