Contributing¶
Contributions are welcome! This guide will help you get started.
Development Setup¶
# Clone repository
git clone https://github.com/nordstad/PinViz.git
cd PinViz
# Install dependencies
uv sync --dev
# Run tests
uv run pytest
# Lint and format
uv run ruff check .
uv run ruff format .
Code Quality¶
All code must pass:
- Ruff linting and formatting
- All unit tests
- Type checking
Adding Device Configurations¶
When contributing new device configurations:
- Use the interactive wizard:
uv run pinviz add-device - Validate your configuration:
uv run pinviz validate-devices - Test loading the device programmatically:
- Ensure validation passes with no errors
The device validator checks: - Schema compliance (required fields, valid types) - Pin configuration correctness - I2C address format (if applicable) - No duplicate device IDs
Example workflow:
# Create device configuration interactively
uv run pinviz add-device
# Validate all device configs
uv run pinviz validate-devices
# Run tests to ensure nothing broke
uv run pytest
Submitting Changes¶
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- For device configs, run
pinviz validate-devices - Submit a pull request
Documentation¶
Update documentation when adding new features. Documentation is built with MkDocs.
# Install docs dependencies
uv sync --group docs
# Serve docs locally
uv run mkdocs serve
# Build docs
uv run mkdocs build
Docs Release Checklist¶
Run these checks before publishing docs or cutting a release that includes documentation changes:
# 1. Build docs — confirms no broken nav or missing pages
uv run mkdocs build --strict
# 2. Check CLI docs are in sync with pinviz --help output
uv run python scripts/check_cli_docs.py
# 3. Manually verify any board/device list pages match pinviz list output
uv run pinviz list
Manual checks:
- [ ]
docs/guide/cli.mdboard list matchespinviz listoutput - [ ]
docs/guide/yaml-config.mdboard list matchespinviz listoutput - [ ]
docs/troubleshooting.mdboard alias table matchespinviz listoutput - [ ]
CHANGELOG.mdhas an entry for any user-facing changes in this release - [ ] New features have corresponding docs pages added to
mkdocs.ymlnav - [ ] Any new CLI commands or options are documented in
docs/guide/cli.md
The check_cli_docs.py script catches drift between pinviz --help and cli.md
automatically. It exits with status 1 if any CLI options are not documented in cli.md,
or if options documented in cli.md no longer match the CLI.