|
| 1 | +# Contributing to mcpbridge-wrapper |
| 2 | + |
| 3 | +Thank you for your interest in contributing! This document outlines the development workflow and quality gates. |
| 4 | + |
| 5 | +## Development Setup |
| 6 | + |
| 7 | +```bash |
| 8 | +# Clone the repository |
| 9 | +git clone https://github.com/SoundBlaster/XcodeMCPWrapper.git |
| 10 | +cd XcodeMCPWrapper |
| 11 | + |
| 12 | +# Install in editable mode with dev dependencies |
| 13 | +pip install -e ".[dev]" |
| 14 | +``` |
| 15 | + |
| 16 | +## Quality Gates |
| 17 | + |
| 18 | +All code must pass the following quality gates before being merged: |
| 19 | + |
| 20 | +### 1. Tests (pytest) |
| 21 | + |
| 22 | +Run all tests with coverage: |
| 23 | + |
| 24 | +```bash |
| 25 | +pytest tests/ -v --cov=src --cov-report=term |
| 26 | +``` |
| 27 | + |
| 28 | +Requirements: |
| 29 | +- All tests must pass |
| 30 | +- Coverage must remain ≥90% |
| 31 | + |
| 32 | +### 2. Linting (ruff) |
| 33 | + |
| 34 | +Check for code issues: |
| 35 | + |
| 36 | +```bash |
| 37 | +ruff check src/ tests/ |
| 38 | +``` |
| 39 | + |
| 40 | +Auto-fix issues where possible: |
| 41 | + |
| 42 | +```bash |
| 43 | +ruff check src/ tests/ --fix |
| 44 | +``` |
| 45 | + |
| 46 | +### 3. Formatting (ruff) |
| 47 | + |
| 48 | +Check code formatting: |
| 49 | + |
| 50 | +```bash |
| 51 | +ruff format --check src/ tests/ |
| 52 | +``` |
| 53 | + |
| 54 | +Apply formatting: |
| 55 | + |
| 56 | +```bash |
| 57 | +ruff format src/ tests/ |
| 58 | +``` |
| 59 | + |
| 60 | +### 4. Type Checking (mypy) |
| 61 | + |
| 62 | +```bash |
| 63 | +mypy src/ |
| 64 | +``` |
| 65 | + |
| 66 | +### 5. Doc Sync Check |
| 67 | + |
| 68 | +Ensure documentation changes are synced with DocC catalog: |
| 69 | + |
| 70 | +```bash |
| 71 | +make doccheck |
| 72 | +# or |
| 73 | +python scripts/check_doc_sync.py |
| 74 | +``` |
| 75 | + |
| 76 | +This checks that changes to `docs/*.md` files are also reflected in the DocC catalog (`mcpbridge-wrapper.docc/`). |
| 77 | + |
| 78 | +### 6. Build Verification |
| 79 | + |
| 80 | +Ensure the package builds correctly: |
| 81 | + |
| 82 | +```bash |
| 83 | +python -m build |
| 84 | +twine check dist/* |
| 85 | +``` |
| 86 | + |
| 87 | +## Quick Check Script |
| 88 | + |
| 89 | +Run all quality gates at once: |
| 90 | + |
| 91 | +```bash |
| 92 | +make test && make lint && make typecheck |
| 93 | +``` |
| 94 | + |
| 95 | +Or use this bash script (save as `check.sh`): |
| 96 | + |
| 97 | +```bash |
| 98 | +#!/bin/bash |
| 99 | +set -e |
| 100 | + |
| 101 | +echo "=== Running Quality Gates ===" |
| 102 | + |
| 103 | +echo "1. Running tests..." |
| 104 | +pytest tests/ -v --cov=src --cov-report=term |
| 105 | + |
| 106 | +echo "2. Running linter..." |
| 107 | +ruff check src/ tests/ |
| 108 | + |
| 109 | +echo "3. Checking format..." |
| 110 | +ruff format --check src/ tests/ |
| 111 | + |
| 112 | +echo "4. Running type checker..." |
| 113 | +mypy src/ |
| 114 | + |
| 115 | +echo "5. Checking doc sync..." |
| 116 | +python scripts/check_doc_sync.py |
| 117 | + |
| 118 | +echo "6. Building package..." |
| 119 | +python -m build && twine check dist/* |
| 120 | + |
| 121 | +echo "=== All Quality Gates Passed ===" |
| 122 | +``` |
| 123 | + |
| 124 | +Make it executable and run: |
| 125 | + |
| 126 | +```bash |
| 127 | +chmod +x check.sh |
| 128 | +./check.sh |
| 129 | +``` |
| 130 | + |
| 131 | +## Workflow |
| 132 | + |
| 133 | +We follow the [FLOW.md](SPECS/COMMANDS/FLOW.md) workflow: |
| 134 | + |
| 135 | +1. **BRANCH** - Create a feature branch from `main` |
| 136 | +2. **SELECT** - Pick a task from the workplan |
| 137 | +3. **PLAN** - Create a PRD for the task |
| 138 | +4. **EXECUTE** - Implement and run quality gates |
| 139 | +5. **ARCHIVE** - Move completed task to archive |
| 140 | + |
| 141 | +## Pull Request Process |
| 142 | + |
| 143 | +1. Create a feature branch: `git checkout -b feature/TASK-ID-description` |
| 144 | +2. Make your changes and run quality gates |
| 145 | +3. Commit with clear messages |
| 146 | +4. Push to your fork |
| 147 | +5. Create a Pull Request against `main` |
| 148 | + |
| 149 | +## CI/CD |
| 150 | + |
| 151 | +All PRs trigger GitHub Actions CI which runs: |
| 152 | +- Lint & Type Check (Python 3.11) |
| 153 | +- Tests (Python 3.9, 3.10, 3.11, 3.12) |
| 154 | +- Package Build |
| 155 | + |
| 156 | +See [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for details. |
| 157 | + |
| 158 | +## Code Style |
| 159 | + |
| 160 | +- Follow PEP 8 guidelines |
| 161 | +- Use type hints where possible |
| 162 | +- Write docstrings for public functions |
| 163 | +- Keep functions focused and small |
| 164 | + |
| 165 | +## Questions? |
| 166 | + |
| 167 | +Open an issue or check the [troubleshooting guide](docs/troubleshooting.md). |
0 commit comments