diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..61feb42f --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to the Machine Vision Toolbox for Python + +Thanks for your interest in contributing! We welcome bug reports, fixes, new features, and documentation improvements. + +## Reporting issues + +Please use the issue template and include: + +- Your operating system, Python version, and machinevisiontoolbox version +- A short, self-contained code example that reproduces the problem + +## Looking for somewhere to start? + +Issues labelled [`good first issue`](https://github.com/petercorke/machinevision-toolbox-python/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or [`help wanted`](https://github.com/petercorke/machinevision-toolbox-python/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are a good place to start. + +## Contributing code + +- Keep pull requests scoped to a single feature or fix. If you have several unrelated changes, open separate PRs so each can be reviewed and merged independently. +- For API changes, propose the change in [Discussions](https://github.com/petercorke/machinevision-toolbox-python/discussions) before opening a PR. +- PR titles follow [Conventional Commits](https://www.conventionalcommits.org/) (`type: description`) — checked automatically on the PR. +- Code is linted and import-sorted with [ruff](https://docs.astral.sh/ruff/) and formatted with [black](https://pypi.org/project/black/); configuration is in `pyproject.toml` under `[tool.ruff]` and `[tool.black]`. Type checking is done with [pyright](https://microsoft.github.io/pyright/) (`[tool.pyright]`). +- New or changed code should be type-hinted using modern syntax (`X | Y`, `X | None`, `list[X]`, `dict[K, V]` — not `Union`, `Optional`, `List`, `Dict`). +- Docstrings use reST style (`:param:`, `:returns:`). Type hints in the function signature already cover types, so `:type:`/`:rtype:` are rarely needed. +- Any code change should be covered by tests and must not break existing ones. Tests live in `tests/`. Install the dev dependencies with `pip install -e '.[dev]'` (add `,docs` too if you're touching documentation), then run: + + ``` + python -m pytest --timeout=50 --timeout-method=thread + ``` + +- Target branch is `main`. + +## License + +By contributing, you agree that your contributions will be licensed under this project's [MIT License](LICENSE).