Thank you for your interest in contributing to Web Agent! This document provides guidelines and instructions for contributing to this project.
WebAgent requires:
- Python 3.11 or later
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/CursorTouch/Web-Agent.git
cd web-agent- Install the package in development mode:
pip install -e ".[dev,search]"- Set up pre-commit hooks:
pip install pre-commit
pre-commit installmainbranch contains the latest stable code- Create feature branches from
mainnamed according to the feature you're implementing:feature/your-feature-name - For bug fixes, use:
fix/bug-description
For now no commit style is enforced, try to keep your commit messages informational.
Key style guidelines:
- Line length: 100 characters
- Use double quotes for strings
- Follow PEP 8 naming conventions
- Add type hints to function signatures
We use pre-commit hooks to ensure code quality before committing. The configuration is in .pre-commit-config.yaml.
The hooks will:
- Run linting checks
- Check for trailing whitespace and fix it
- Ensure files end with a newline
- Validate YAML files
- Check for large files
- Remove debug statements
Run the test suite with pytest:
pytestTo run specific test categories:
pytest tests/- Add unit tests for new functionality in
tests/unit/ - For slow or network-dependent tests, mark them with
@pytest.mark.slowor@pytest.mark.integration - Aim for high test coverage of new code
- Ensure your code passes all tests and pre-commit hooks
- Push your changes to your fork
- Submit a pull request to the main repository
- Follow the pull request template
- Update docstrings for new or modified functions, classes, and methods
- Use Google-style docstrings:
def function_name(param1: type, param2: type) -> return_type:
"""Short description.
Longer description if needed.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ExceptionType: When and why this exception is raised
"""If you need help with your contribution:
- Open an issue for discussion
- Reach out to any of the our maintainers
We look forward to your contributions!