mgit/is the main package. Key areas:commands/(CLI commands),providers/(GitHub/Azure DevOps/BitBucket implementations),config/(YAML config),git/(git ops),security/,utils/.tests/holds the pytest suite;docs/contains provider guides;scripts/has build helpers.mgit.specdrives PyInstaller builds;dist/andbuild/are build outputs.
- ADRs in
docs/ADR/document key design decisions (provider abstraction, config hierarchy, concurrency, pattern matching). - Read relevant ADRs before modifying core architecture.
- Setup (preferred):
uv sync --all-extras --dev(Poetry alternative:poetry install --with dev). - Run locally:
uv run mgit --helporpython -m mgit. - Tests:
uv run pytest(orpoetry run pytest). Use markers like-m unitor-m "not requires_network". - Lint/format/type-check:
make validate(runs ruff format, ruff check, ty, bandit). Usemake validate ARGS="--fix"to auto-fix. - Build binaries:
make build-standalone-linux(Linux + install) ormake build-standalone-windows(Windows from WSL).
- NEVER manually edit the version in
pyproject.tomland push. Usemake release ARGS="--bump patch|minor|major"which validates, bumps, commits, and pushes. - Pushing a version change to
maintriggersauto-release.yml(quality checks + unit tests → release notes → GitHub Release → PyPI). make versionrunsmake validateas a gate — it will refuse to bump if any check fails.- If the release workflow fails after push, fix the code and re-trigger with
gh workflow run auto-release.yml --field force-release=true.
- PEP 8 with Black formatting (88-char lines). Ruff handles linting and import order (E/F/I).
- Type hints are required for public functions; use Google-style docstrings for public APIs.
- Branch naming in CONTRIBUTING uses
feature/<short-name>.
- Pytest is configured for
test_*.py/*_test.pyfiles andtest_*functions. - Use markers:
unit,integration,e2e,slow,requires_network,asyncio. - Coverage uses
pytest-covand outputshtmlcov/pluscoverage.xmlwhen enabled.
- Recent history uses short imperative summaries (e.g., “Fix …”, “Update …”) and allows merge commits.
- CONTRIBUTING recommends Conventional Commits for new work (
feat:,fix:,docs:…). - PRs should include: a concise summary, tests run, docs updates if applicable, and a linked issue when relevant. Add provider-specific tests and docs when changing a provider.
- Local config lives at
~/.config/mgit/config.yaml. Usemgit loginto store provider credentials and avoid committing tokens or config files.