Thank you for your interest in contributing to ScrapeGen! This document provides guidelines and information about contributing to this project.
- Code of Conduct
- Getting Started
- Development Process
- Pull Request Process
- Coding Standards
- Testing Guidelines
- Documentation
- Issue Reporting
- Security Issues
By participating in this project, you agree to abide by our Code of Conduct:
- Use welcoming and inclusive language
- Be respectful of different 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/scrapegen.git
cd scrapegen
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
- Create a branch for your work:
git checkout -b feature/your-feature-name
- Choose an issue to work on or create a new one
- Comment on the issue to let others know you're working on it
- Write your code following our coding standards
- Add tests for your changes
- Update documentation as needed
- Submit a pull request
# Install pre-commit hooks
pip install pre-commit
pre-commit install
# Install development dependencies
pip install -e ".[dev]"
- Update the README.md with details of changes if needed
- Update the documentation with details of changes if needed
- Add your changes to the CHANGELOG.md under "Unreleased"
- Ensure all tests pass and code style checks succeed
- Include a clear description of the changes in your PR
- Link any relevant issues in your PR description
- feat: Add new feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc)
- refactor: Code refactoring
- test: Adding tests
- chore: Maintenance tasks
- Follow PEP 8 guidelines
- Use type hints for all function arguments and return values
- Write docstrings for all public modules, functions, classes, and methods
- Maximum line length is 88 characters (using Black formatter)
# Format code
black src tests
# Sort imports
isort src tests
# Run type checking
mypy src
- Classes: PascalCase
- Functions and variables: snake_case
- Constants: UPPERCASE_WITH_UNDERSCORES
- Private attributes/methods: _leading_underscore
- Write unit tests for all new functionality
- Maintain test coverage above 90%
- Use pytest for testing
- Place tests in the
tests/
directory - Name test files with
test_
prefix
# Run tests
pytest
# Run tests with coverage
pytest --cov=src/scrapegen tests/
# Run specific test file
pytest tests/test_specific_file.py
- Use Google-style docstrings
- Update documentation for any new features or changes
- Include examples in docstrings
- Keep API documentation up to date
Example docstring:
def function_name(param1: str, param2: int) -> bool:
"""Short description of function.
Longer description of function if needed.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ValueError: Description of when this error occurs
"""
When reporting bugs, please include:
- Description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment information:
- Python version
- ScrapeGen version
- Operating system
- Any relevant dependencies
When requesting features, please include:
- Clear description of the feature
- Use cases
- Expected behavior
- Alternative solutions considered
- Example implementation if possible
Contributors will be recognized in the following ways:
- Added to CONTRIBUTORS.md file
- Mentioned in release notes for significant contributions
- Listed in the project documentation
If you have questions about contributing, please:
- Check the documentation
- Search existing issues
- Open a new issue with the "question" label
- Join our community chat/forum
Thank you for contributing to ScrapeGen