Contributing
We welcome contributions to SlicerMouseMaster! This guide explains how to contribute effectively.
Ways to Contribute
Bug reports: File issues for problems you encounter
Feature requests: Suggest new functionality
Code contributions: Submit pull requests
Documentation: Improve guides and examples
Presets: Share your button configurations
Mouse profiles: Add support for new mice
Development Setup
Fork the repository on GitHub
Clone your fork:
git clone https://github.com/YOUR_USERNAME/SlicerMouseMaster.git cd SlicerMouseMaster
Set up development environment:
uv sync uv run pre-commit install
Create a feature branch:
git checkout -b feature/your-feature-name
Code Style
We use automated tools to maintain consistent code style:
Ruff: Linting and formatting
Mypy: Type checking
Run checks before committing:
make lint # Run linter
make format # Format code
make typecheck # Run type checker
make check # Run lint and typecheck together
Pre-commit hooks run these automatically.
Commit Messages
Follow conventional commit format:
<type>: <short summary>
[optional body with details]
[optional footer with references]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlyrefactor: Code change that neither fixes a bug nor adds a featuretest: Adding or updating testschore: Maintenance tasks
Examples:
feat: add MX Master 4 support
- Add mouse definition JSON
- Create default preset
- Update supported mice documentation
Closes #42
fix: handle missing preset file gracefully
Previously the module would crash if a preset file was deleted
while MouseMaster was running. Now it shows an error message
and falls back to the default preset.
Pull Requests
Keep PRs focused: One feature or fix per PR
Update documentation: Add or update docs for your changes
Add tests: Include unit tests for new functionality
Run the test suite: Ensure all tests pass
Write a clear description: Explain what and why
PR Template:
## Summary
Brief description of changes.
## Changes
- Change 1
- Change 2
## Testing
- [ ] Unit tests pass
- [ ] Manual testing completed
- [ ] Documentation updated
## Related Issues
Closes #123
Reporting Bugs
Good bug reports include:
Slicer version: Help > About 3D Slicer
Operating system: Windows/macOS/Linux and version
Mouse model: The mouse you’re using
Steps to reproduce: Detailed steps to trigger the bug
Expected behavior: What should happen
Actual behavior: What actually happens
Error messages: From Python console (View > Python Console)
Screenshots: If applicable
Feature Requests
When requesting features:
Check existing issues: Someone may have already requested it
Describe the use case: Why do you need this?
Suggest implementation: If you have ideas
Be open to discussion: The best solution may differ from your initial idea
Contributing Presets
Share your button configurations:
Export your preset from MouseMaster
Add author and description to the JSON
Submit via:
GitHub issue with the file attached
Pull request to
presets/community/
See Preset Format for preset format details.
Contributing Mouse Profiles
Add support for new mice:
Create mouse definition JSON
Create default preset
Test on your hardware
Submit pull request
See Adding Mouse Profiles for detailed instructions.
Code of Conduct
Be respectful and inclusive
Focus on constructive feedback
Help others learn and grow
Follow the Slicer Community Guidelines
Getting Help
Questions: Open a GitHub Discussion
Chat: Join the Slicer Discord
Forum: Post on Slicer Discourse
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.