Contributing
Thank you for considering a contribution to moles-tools! 🎉
Getting Started
- Fork the repository and clone your fork.
- Follow the installation guide to set up your dev environment.
- Create a feature branch:bash
git checkout -b feat/my-new-tool - Make your changes, add tests, and update the documentation.
- Push your branch and open a Pull Request against
main.
Coding Conventions
- Python ≥ 3.11 — use modern type-hint syntax.
- Full type annotations on all public functions (
mypy --strict). - Google-style docstrings.
- Formatting:
black(line-length = 88). - Linting:
ruffwith theE,F,I,N,W,B,UPrule set. - No bare
except— always catch specific exception types.
Adding a New Tool
- Create
src/moles_tools/<tool_name>.py. - Implement a
main(argv: list[str] | None = None) -> intCLI entry point. - Register it in
pyproject.tomlunder[project.scripts]. - Add
tests/test_<tool_name>.pywith happy-path and error-path tests. - Add a documentation page at
docs/tools/<tool-name>.md. - Link the new page in
docs/.vitepress/config.ts.
Commit Message Format
Follow the Conventional Commits specification. The semantic-versioning workflow reads special tokens from the commit body:
| Token | Effect |
|---|---|
#major | Bumps major version (breaking change) |
#minor | Bumps minor version (new feature) |
| (default) | Bumps patch version (bug fix) |
Running the Checks Locally
bash
# All pre-commit hooks
uv run pre-commit run --all-files
# Tests with coverage
uv run pytest
# Individual linters
uv run ruff check src/ tests/
uv run black --check src/ tests/
uv run mypy src/CI Pipeline
Every pull request is checked by GitHub Actions (ci.yml):
- Linting (ruff, black)
- Type checking (mypy)
- Tests on Ubuntu (latest & 22.04), macOS, and Windows, for Python 3.11 and 3.12
All checks must pass before a PR can be merged.