-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Hunter edited this page Jan 15, 2026
·
1 revision
Thank you for your interest in contributing to the Wisp Framework! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Testing
- Documentation
- Submitting Changes
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect different viewpoints and experiences
- Python 3.13+
- Git
- Basic understanding of Discord bots and Python
# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/yourusername/wisp.git
cd wisp
# Add upstream remote
git remote add upstream https://github.com/redkeysh/wisp.gitpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate# Install in editable mode with all extras
pip install -e ".[db,redis,all]"
# Install development dependencies
pip install pytest pytest-asyncio ruff mypy# Copy example environment file
cp .env.local.example .env.local
# Edit .env.local with your Discord token
# DISCORD_TOKEN=your_token_here# Run all tests
pytest
# Run with coverage
pytest --cov=src/wisp_framework
# Run specific test
pytest tests/test_module.pyUse descriptive branch names:
-
feature/description- New features -
fix/description- Bug fixes -
docs/description- Documentation changes -
refactor/description- Code refactoring
# Create feature branch
git checkout -b feature/my-feature
# Make changes
# ...
# Commit changes
git add .
git commit -m "feat: add my feature"
# Push to your fork
git push origin feature/my-feature
# Create pull request on GitHubAlways use type hints:
from typing import Optional, List
def my_function(param: str) -> Optional[int]:
return NoneWe use ruff for formatting:
# Format code
ruff format src/
# Check code
ruff check src/Maximum line length: 100 characters
Organize imports:
# Standard library
import os
from typing import Optional
# Third-party
import discord
# Local
from wisp_framework.module import ModuleUse Google-style docstrings:
def my_function(param: str) -> int:
"""Brief description.
Longer description if needed.
Args:
param: Parameter description
Returns:
Return value description
Raises:
ValueError: When param is invalid
"""
passimport pytest
from wisp_framework.module import Module
def test_module_creation():
class TestModule(Module):
@property
def name(self) -> str:
return "test"
async def setup(self, bot, ctx):
pass
module = TestModule()
assert module.name == "test"- Tests go in
tests/directory - Test files:
test_*.py - Test functions:
test_* - Test classes:
Test*
# All tests
pytest
# Specific file
pytest tests/test_module.py
# Specific test
pytest tests/test_module.py::test_module_creation
# With coverage
pytest --cov=src/wisp_framework --cov-report=html- Add docstrings to all public functions and classes
- Document parameters and return values
- Include examples for complex functions
When adding features:
- Update relevant documentation files
- Add examples if applicable
- Update API reference if needed
- Update changelog
-
docs/API_REFERENCE.md- API documentation -
docs/ARCHITECTURE.md- Architecture overview -
docs/MODULE_DEVELOPMENT.md- Module development guide -
README.md- Main readme
-
Update your fork
git fetch upstream git checkout main git merge upstream/main
-
Create feature branch
git checkout -b feature/my-feature
-
Make changes
- Write code
- Add tests
- Update documentation
- Format code
-
Commit changes
git add . git commit -m "feat: add my feature"
-
Push to fork
git push origin feature/my-feature
-
Create Pull Request
- Go to GitHub
- Click "New Pull Request"
- Fill out PR template
- Submit
Use Conventional Commits:
-
feat:- New feature -
fix:- Bug fix -
docs:- Documentation changes -
style:- Code style changes -
refactor:- Code refactoring -
test:- Test changes -
chore:- Maintenance tasks
Examples:
feat: add pagination support
fix: resolve database connection issue
docs: update API reference
- Code follows style guidelines
- Tests pass
- Documentation updated
- Type hints added
- No breaking changes (or documented)
- Commit messages follow conventions
-
Automated Checks
- Tests must pass
- Code must be formatted
- Type checks must pass
-
Code Review
- Maintainers review code
- Address feedback
- Make requested changes
-
Merge
- Approved PRs are merged
- Changes are included in next release
- Open an issue for questions
- Check existing documentation
- Ask in discussions
Your contributions make the Wisp Framework better for everyone. Thank you for contributing!