Contributing¶
Guidelines for contributing to Tinko.
Getting Started¶
- Fork the repository on GitHub
- Clone your fork locally
- Set up development environment (see Developer Setup)
- Create a new branch for your feature
Development Workflow¶
1. Create a Branch¶
2. Make Changes¶
- Write clear, documented code
- Follow PEP 8 style guidelines
- Add tests for new features
- Update documentation
3. Test Your Changes¶
4. Commit Changes¶
Commit Message Format:
Types:
- feat: - New feature
- fix: - Bug fix
- docs: - Documentation
- style: - Formatting
- refactor: - Code refactoring
- test: - Tests
- chore: - Maintenance
5. Push and Create Pull Request¶
Then create a pull request on GitHub.
Code Style¶
Python¶
- Follow PEP 8
- Use 4 spaces for indentation
- Max line length: 88 characters (Black default)
- Use type hints
- Write docstrings
Example¶
def calculate_average(values: list[float]) -> float:
"""Calculate average of values.
Args:
values: List of numbers
Returns:
Average value
Raises:
ValueError: If values is empty
"""
if not values:
raise ValueError("Cannot calculate average of empty list")
return sum(values) / len(values)
Documentation¶
- Update README if needed
- Add docstrings to functions
- Update relevant .md files
- Include code examples
Testing Requirements¶
- All new features need tests
- Bug fixes should include regression tests
- Tests should pass before merging
- Aim for >80% coverage
Review Process¶
- Automated Checks
- Tests must pass
- Code style checks
-
Security scans
-
Manual Review
- Code review by maintainer
- Documentation review
-
Testing on Raspberry Pi
-
Merge
- Squash and merge
- Clean commit history
Plugin Contributions¶
Submitting a Plugin¶
- Create plugin in
plugins/community/ - Include README with:
- Description
- Installation instructions
- Hardware requirements
- Usage examples
- Add tests
- Submit PR
Plugin Guidelines¶
- Unique namespace (author.pluginname)
- Proper metadata
- Error handling
- GPIO cleanup
- Documentation
Questions?¶
- Open an issue on GitHub
- Join discussions
- Check existing documentation
Code of Conduct¶
- Be respectful
- Help others
- Give constructive feedback
- Focus on what's best for the project
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.