Contributing to Bijux CLI¶
This guide is the single source of truth for local setup, workflows, API validation, and PR rules. Follow it to ensure your changes pass CI seamlessly.️
Table of Contents¶
- Quick Start
- Daily Workflow
- API Development
- Docs
- Tests & Coverage
- Style, Types, Hygiene
- Security & Supply Chain
- Tox Envs (Mirror CI)
- Commits & PRs
- Troubleshooting
- Community & Conduct
Quick Start¶
Prereqs
- Python 3.11 / 3.12 / 3.13 (
pyenvrecommended) - GNU Make
- Node.js + npm (for API validation tooling)
Setup
git clone https://github.com/bijux/bijux-cli.git
cd bijux-cli
make PYTHON=python3.11 install
source .venv/bin/activate
Sanity check
- ✔ Pass → your env matches CI
- ✘ Fail → jump to Troubleshooting
Daily Workflow¶
- Everything runs inside .venv/
- No global installs after
make install - Make targets mirror CI jobs 1:1
Core targets
| Target | What it does |
|---|---|
make test | pytest + coverage (HTML in htmlcov/) |
make lint | Format (ruff), lint (ruff), type-check (mypy), complexity (radon) |
make quality | Dead code (vulture), deps hygiene (deptry), REUSE, docstrings (interrogate) |
make security | Bandit + pip-audit |
make api | OpenAPI lint + generator compat + Schemathesis contract tests |
make docs | Build MkDocs (strict) |
make build | Build sdist + wheel |
make sbom | CycloneDX SBOM → artifacts/sbom.json |
make mutation | Mutation testing (Cosmic Ray + Mutmut) |
Handy helpers
make lint-file file=path/to/file.py
make docs-serve # local docs server
# make docs-deploy # if you have perms
API Development¶
Schema: api/v1/schema.yaml Tooling: Prance, OpenAPI Spec Validator, Redocly, OpenAPI Generator, Schemathesis
Validate locally
Contract rules
- Errors use RFC 7807 Problem JSON
- Response shapes and pagination are stable or versioned
- Breaking changes require a versioned path and a changelog entry
Docs¶
- Config:
mkdocs.yml(Material, strict) - Build:
make docs - Serve:
make docs-serve - Deploy:
make docs-deploy(if authorized)
Tests & Coverage¶
- Run all tests:
make test - Focused run:
pytest -k "<expr>" -q - Coverage report: HTML in
htmlcov/ - Project bar: \~2,600+ tests with ≥98% coverage across unit/integration/functional/E2E. Keep it green.
Style, Types, Hygiene¶
- Formatting:
ruff format(enforced inmake lint) - Linting:
ruff - Types:
mypy(strict) - Complexity:
radon - Docstrings:
interrogate(meet configured thresholds)
Run them all:
Security & Supply Chain¶
- No secrets in code or tests
- Keep dependency pins sane; document any suppressions
Tox Envs (Mirror CI)¶
| Env | Runs |
|---|---|
py311 / py312 / py313 | make test |
lint | make lint |
quality | make quality |
security | make security |
api | make api |
docs | make docs |
build | make build |
sbom | make sbom |
List all:
Commits & PRs¶
Conventional Commits (required)¶
Types: feat fix docs style refactor test chore
Example
Breaking changes must include:
Commit messages are validated (Commitizen).
PR Checklist¶
- Branch from
main - Run:
Troubleshooting¶
- Missing Node.js → required for API validation tools
- Docs fail → MkDocs is strict; fix broken links/includes
- Port in use for API tests → kill old
uvicornor use a different port
Community & Conduct¶
Be kind and constructive. See the Code of Conduct in the docs site. If you see something off, let us know.
Build well. Break nothing.