Thank you for considering contributing to Forge! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to uphold our Code of Conduct:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/forge.git cd forge - Set up the development environment:
# Create and activate virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Install development dependencies pip install -r requirements-dev.txt
- Add the upstream repository:
git remote add upstream https://github.com/originalowner/forge.git
-
Create a branch for your feature or bugfix:
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-you-are-fixing -
Make your changes and commit them with clear, descriptive commit messages:
git add . git commit -m "Add feature: concise description of changes"
-
Keep your branch updated with the upstream repository:
git fetch upstream git rebase upstream/main
-
Push your changes to your fork:
git push origin feature/your-feature-name
- Submit a pull request from your forked repository to the main Forge repository
- Describe your changes in detail, including the issue number if applicable
- Update documentation to reflect any changes you've made
- Ensure all tests pass and add new tests for new functionality
- Request a review from a maintainer
- Address review feedback and make requested changes
- Once approved, a maintainer will merge your PR
We follow Python's PEP 8 style guide with some adjustments:
- Use 4 spaces for indentation
- Maximum line length of 100 characters
- Use docstrings for all public modules, functions, classes, and methods
- Use type hints where appropriate
- Use descriptive variable names
We use pre-commit hooks to ensure code quality. To set up:
pip install pre-commit
pre-commit installWe use pytest for testing. Please write tests for new code you create:
# Run tests
pytest
# Run tests with coverage
pytest --cov=appGuidelines for writing tests:
- Each test should be independent and not rely on the state from previous tests
- Use fixtures for setup and teardown
- Name tests clearly:
test_should_do_something_when_something() - Aim for high test coverage of new code
- Update documentation for any changes to functionality
- Use clear, concise language
- Include code examples where helpful
- Keep the README.md up-to-date
- Document API endpoints clearly
When reporting issues, please use the issue templates provided and include:
- Steps to reproduce the problem
- Expected behavior
- Actual behavior
- Version information:
- Forge version
- Python version
- Operating system
- Any other relevant environment details
For feature requests, describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
For maintainers only:
- Update the version in setup.py and app/version.py
- Update the CHANGELOG.md
- Create a new GitHub release with release notes
- Push a new tag matching the version number
Your contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.