|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for your interest in contributing! This guide will help you get |
| 4 | +started. |
| 5 | + |
| 6 | +## Development Setup |
| 7 | + |
| 8 | +1. **Clone the repository** |
| 9 | + |
| 10 | + ```bash |
| 11 | + git clone https://github.com/Wandersalamander/python-content-tree-generator.git |
| 12 | + cd python-content-tree-generator |
| 13 | + ``` |
| 14 | + |
| 15 | +2. **Create a virtual environment** |
| 16 | + |
| 17 | + ```bash |
| 18 | + python -m venv .venv |
| 19 | + source .venv/bin/activate # Linux / macOS |
| 20 | + .venv\Scripts\activate # Windows |
| 21 | + ``` |
| 22 | + |
| 23 | +3. **Install in editable mode with dev and test extras** |
| 24 | + |
| 25 | + ```bash |
| 26 | + pip install -e ".[dev,test]" |
| 27 | + ``` |
| 28 | + |
| 29 | +4. **Install the pre-commit hooks** |
| 30 | + |
| 31 | + ```bash |
| 32 | + pre-commit install |
| 33 | + ``` |
| 34 | + |
| 35 | +## Running Tests |
| 36 | + |
| 37 | +```bash |
| 38 | +pytest |
| 39 | +``` |
| 40 | + |
| 41 | +With coverage: |
| 42 | + |
| 43 | +```bash |
| 44 | +pytest --cov --cov-report=term-missing |
| 45 | +``` |
| 46 | + |
| 47 | +## Code Standards |
| 48 | + |
| 49 | +- **Formatting & linting** are handled by [Ruff](https://github.com/astral-sh/ruff). |
| 50 | +- **Type checking** is done with [ty](https://github.com/astral-sh/ty). |
| 51 | +- **Pre-commit hooks** run automatically on every commit. You can also run |
| 52 | + them manually: |
| 53 | + |
| 54 | + ```bash |
| 55 | + pre-commit run --all-files |
| 56 | + ``` |
| 57 | + |
| 58 | +- All code must include type annotations and pass the type checker. |
| 59 | +- Aim for clear, single-responsibility functions with docstrings. |
| 60 | + |
| 61 | +## Submitting Changes |
| 62 | + |
| 63 | +1. Fork the repository and create a feature branch from `main`. |
| 64 | +2. Make your changes and add tests where appropriate. |
| 65 | +3. Ensure all checks pass (`pre-commit run --all-files && pytest`). |
| 66 | +4. Open a pull request with a clear description of the change. |
| 67 | + |
| 68 | +## Reporting Issues |
| 69 | + |
| 70 | +Please use [GitHub Issues](https://github.com/Wandersalamander/python-content-tree-generator/issues) |
| 71 | +to report bugs or request features. Include: |
| 72 | + |
| 73 | +- Steps to reproduce (for bugs). |
| 74 | +- Expected vs. actual behaviour. |
| 75 | +- Python version and OS. |
0 commit comments