Contributing¶
Contributing to elfshoe¶
Thank you for your interest in contributing to elfshoe! This document provides guidelines and instructions for contributing.
๐ฏ How to Contribute¶
Reporting Bugs¶
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear, descriptive title
- Detailed description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Your environment (OS, Python version, package versions)
- Relevant logs or error messages
Suggesting Enhancements¶
- Check existing Issues and Pull Requests
- Create a new issue describing:
- The enhancement you'd like to see
- Why it would be useful
- Possible implementation approaches
Pull Requests¶
- Fork the repository
- Clone your fork locally
- Create a branch for your changes:
- Make your changes following our guidelines below
- Test your changes thoroughly
- Commit with clear, descriptive messages
- Push to your fork
- Submit a pull request to the main repository
๐ ๏ธ Development Setup¶
Prerequisites¶
- Python 3.7 or higher
- Git
- Make (optional, but recommended)
Initial Setup¶
# Clone your fork
git clone https://github.com/YOUR_USERNAME/elfshoe.git
cd elfshoe
# Install Hatch
pip install hatch
# Create development environment
hatch env create
# Or use editable install
pip install -e ".[dev]"
# Install pre-commit hooks (recommended)
make pre-commit-install
Pre-commit Hooks¶
This project uses pre-commit hooks to ensure code quality. After installation:
- On commit: Automatically formats code, runs linting, checks docs
- On push: Runs full test suite and verifies package builds
See docs/developer/pre-commit.md for details.
Running Tests¶
# Run all tests
make test
# Run with coverage
make test-coverage
# Run specific test file
pytest tests/test_elfshoe.py
# Using hatch
hatch run test
hatch run test-cov
Code Quality¶
# Check code style
make lint
# Auto-format code
make format
# Or with hatch
hatch run lint:check
hatch run lint:format
๐ Code Guidelines¶
Style Guide¶
- Follow PEP 8 style guidelines
- Use Black for formatting (line length: 88)
- Use Ruff for linting
- Write clear, descriptive variable and function names
- Add docstrings for public functions and classes
Code Structure¶
- Keep functions focused and single-purpose
- Use type hints where appropriate
- Avoid deep nesting (max 3-4 levels)
- Extract complex logic into separate functions
- Use dataclasses for data structures
Testing¶
- Write tests for all new features
- Maintain or improve test coverage
- Test both success and failure cases
- Use descriptive test names that explain what is being tested
- Group related tests in test classes
Documentation¶
- Update relevant documentation for your changes
- Add docstrings for new functions/classes
- Update README.md if adding user-facing features
- Include code examples for new features
๐ Adding New Distributions¶
See adding_distributions.md for detailed instructions on adding support for new operating systems.
Quick Checklist¶
- Create a metadata fetcher class in
src/elfshoe/distributions/ - Inherit from
AbstractMetadataFetcher - Implement
fetch_versions()method - Register in
src/elfshoe/distributions/__init__.py - Add tests in
tests/ - Update documentation
- Add example configuration to README
๐งช Testing Checklist¶
Before submitting a pull request, ensure:
- [ ] Pre-commit hooks are installed (
make pre-commit-install) - [ ] All tests pass (
make test) - [ ] Code is formatted (
make format) - [ ] Linting passes (
make lint) - [ ] Coverage hasn't decreased (
make test-coverage) - [ ] Documentation is updated
- [ ] New features have tests
- [ ] Examples work as documented
Note: Pre-commit hooks will automatically check most of these before commit/push.
๐ Commit Messages¶
Write clear, descriptive commit messages:
feat: Add support for Ubuntu metadata fetcher
- Implement UbuntuMetadataFetcher class
- Add tests for Ubuntu version detection
- Update documentation with Ubuntu example
Commit Message Format¶
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringstyle: Code style changes (formatting)chore: Maintenance tasks
๐ Release Process¶
Releases are handled by maintainers:
- Update version in
pyproject.toml - Create and tag release
- Build and publish to PyPI:
๐ก Need Help?¶
- Check the documentation
- Look at existing code for examples
- Review closed pull requests for similar changes
- Open an issue for questions
- Reach out to maintainers
๐ Code of Conduct¶
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Assume good intentions
- Help others learn and grow
๐ Recognition¶
Contributors are recognized in:
- GitHub contributors list
- Project README (for major features)
Thank you for contributing to elfshoe! ๐