Contributing to Dialogue Guardian
We welcome contributions to Dialogue Guardian! This guide will help you get started with contributing to the project.
Getting Started
Fork the Repository
Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/tsnearly/dialogue-guardian.git cd dialogue-guardian
Set Up Development Environment
# Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install development dependencies cd dialogue-guardian pip install -r dev-requirements.txt pip install -e .
Run Tests
Make sure all tests pass before making changes:
pytest tests/
Development Workflow
Create a Branch
Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
Make Changes
Write your code following the existing style
Add tests for new functionality
Update documentation if needed
Run Quality Checks
# Format code black src/ tests/ isort src/ tests/ # Run linting flake8 src/ tests/ --config .flake8 # Run tests pytest tests/ # Check type hints mypy src/guardian/ --ignore-missing-imports
Commit Changes
Use conventional commit messages:
git add . git commit -m "feat: add new censoring algorithm" git commit -m "fix: resolve audio sync issue" git commit -m "docs: update installation guide"
Push and Create Pull Request
git push origin feature/your-feature-name
Then create a pull request on GitHub.
Code Style Guidelines
Python Style: Follow PEP 8, enforced by Black and flake8
Line Length: 88 characters (Black default)
Import Sorting: Use isort for consistent import organization
Type Hints: Add type hints for new functions and methods
Docstrings: Use Google-style docstrings for all public functions
Testing Guidelines
Write Tests: All new features should include tests
Test Coverage: Aim for high test coverage on new code
Test Types: - Unit tests for individual functions - Integration tests for complete workflows - CLI tests for command-line interface
Test Structure:
def test_function_name(): """Test description.""" # Arrange input_data = "test input" # Act result = function_to_test(input_data) # Assert assert result == expected_output
Documentation Guidelines
Update Documentation: Update relevant documentation for new features
Docstrings: All public functions need docstrings
Examples: Include usage examples in docstrings
README: Update README.md if adding new functionality
Reporting Issues
When reporting bugs or requesting features:
Check Existing Issues: Search existing issues first
Use Templates: Use the provided issue templates
Provide Details: Include: - Python version - Operating system - FFmpeg version - Steps to reproduce - Expected vs actual behavior
Pull Request Process
Description: Provide a clear description of changes
Link Issues: Reference related issues with “Fixes #123”
Tests: Ensure all tests pass
Documentation: Update documentation if needed
Review: Address feedback from code review
Release Process
For maintainers:
Update Version: Update version in
pyproject.tomlUpdate Changelog: Add entry to
CHANGELOG.mdCreate Release: Use GitHub Actions release workflow
Verify: Check that PyPI package is published correctly
Getting Help
GitHub Issues: For bugs and feature requests
GitHub Discussions: For questions and general discussion
Documentation: Check the documentation first
Thank you for contributing to Dialogue Guardian! 🎉