Thank you for your interest in contributing to iFit! This document provides guidelines and instructions for contributing.
-
Prerequisites
- Python 3.11 or higher
- Poetry for dependency management
- Git for version control
-
Initial Setup
# Clone the repository git clone https://github.com/ianchi/ifit.git cd ifit # Run the setup script ./scripts/setup.sh # Activate the virtual environment poetry shell
-
Create a feature branch
git checkout -b features/your-feature-name/description
-
Make your changes
- Write code following the project's style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Run tests and linters
./scripts/lint.sh # Check code quality ./scripts/format.sh # Format code ./scripts/test.sh # Run tests
-
Commit your changes
- Use conventional commit messages
- Pre-commit hooks will run automatically
git add . git commit -m "feat: add new feature description"
We use Conventional Commits:
feat:- A new featurefix:- A bug fixdocs:- Documentation only changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Example: feat: add support for new iFit device model
- Line length: 100 characters
- Indentation: 4 spaces for Python
- Quotes: Double quotes for strings
- Type hints: Required for all function signatures
- Docstrings: Google style for all public APIs
- Write unit tests for all new functionality
- Use pytest markers:
@pytest.mark.unit- Fast unit tests@pytest.mark.integration- Integration tests@pytest.mark.slow- Slow running tests
import pytest
@pytest.mark.unit
def test_example():
assert TruePre-commit hooks automatically run:
- Ruff linting and formatting
- Pyright type checking
- Various file checks
- Spell checking
- Conventional commit validation
To run manually:
pre-commit run --all-files- Ensure all tests pass and code is properly formatted
- Update the README.md or documentation if needed
- Update CHANGELOG.md with your changes
- Create a pull request with a clear description
- Wait for review and address any feedback
- Open an issue for bugs or feature requests
- Use discussions for questions and general discussion
By contributing, you agree that your contributions will be licensed under the MIT License.