Thank you for your interest in contributing to WOG Dump! This document provides guidelines for contributing to the project.
-
Fork and Clone
git clone https://github.com/your-username/ReWOG.git cd ReWOG -
Set up Development Environment
# Install uv if you haven't already curl -LsSf https://astral.sh/uv/install.sh | sh # Create virtual environment with uv uv venv source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate # Windows # Install in development mode uv pip install -e ".[dev]"
-
Install Pre-commit Hooks
pre-commit install
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Follow the existing code style
- Add tests for new functionality
- Update documentation if needed
-
Run Tests
# Run all tests pytest # Run with coverage pytest --cov=wog_dump # Run specific test categories pytest tests/unit/ pytest tests/integration/
-
Format Code
# Format with black black src/ tests/ # Sort imports isort src/ tests/ # Check typing mypy src/ # Lint code flake8 src/ tests/
- Python Version: Python 3.12+
- Formatter: Black (line length 88)
- Import Sorting: isort
- Type Hints: Required for all public functions
- Docstrings: Google style docstrings
Follow conventional commit format:
type(scope): description
Examples:
feat(cli): add new command for batch processing
fix(decrypt): handle empty key files gracefully
docs(readme): update installation instructions
test(download): add tests for parallel downloads
- Unit Tests:
tests/unit/- Test individual components - Integration Tests:
tests/integration/- Test component interactions - Fixtures:
tests/fixtures/- Shared test data
- Test File Naming:
test_module_name.py - Test Function Naming:
test_function_purpose - Test Class Naming:
TestClassName
Example:
class TestDownloadManager:
def test_download_success(self, test_config):
"""Test successful asset download."""
# Test implementation
pass- Aim for >90% test coverage
- All new features must include tests
- Bug fixes should include regression tests
- All public functions need docstrings
- Use Google style docstrings
- Include type hints for all parameters and returns
Example:
def download_asset(self, asset_name: str, force: bool = False) -> bool:
"""Download a single asset from the server.
Args:
asset_name: Name of the asset to download
force: Force download even if file exists
Returns:
True if download was successful, False otherwise
Raises:
DownloadError: If download fails due to network issues
"""- Update README.md for user-facing changes
- Add examples for new CLI commands
- Document configuration options
When reporting bugs, please include:
-
Environment Information
- Python version
- Operating system
- WOG Dump version
-
Steps to Reproduce
- Exact commands run
- Expected behavior
- Actual behavior
-
Error Messages
- Full error traceback
- Log files if available
-
Additional Context
- Screenshots if applicable
- Related issues
For new features:
- Check Existing Issues - Avoid duplicates
- Describe the Problem - What need does this address?
- Propose a Solution - How should it work?
- Consider Alternatives - What other approaches exist?
src/wog_dump/
├── core/ # Core business logic
│ ├── config.py # Configuration management
│ ├── download.py # Asset downloading
│ ├── decrypt.py # Decryption operations
│ └── unpack.py # Asset unpacking
├── utils/ # Utility functions
│ ├── logging.py # Structured logging
│ └── normal_map.py # Normal map conversion
└── cli/ # Command-line interface
└── main.py # CLI commands
- Separation of Concerns - Each module has a single responsibility
- Dependency Injection - Pass dependencies explicitly
- Error Handling - Graceful error recovery with detailed messages
- Type Safety - Use type hints throughout
- Testability - Design for easy testing
- Core Logic - Add business logic to appropriate
core/module - CLI Interface - Add CLI commands in
cli/main.py - Configuration - Add config options to
core/config.py - Tests - Add comprehensive tests
- Documentation - Update docs and examples
Complexity Guidelines:
- Functions should be < 50 lines
- Classes should be < 300 lines
- Files should be < 500 lines
- Cyclomatic complexity < 10
Performance Guidelines:
- Use async/await for I/O operations
- Implement proper caching strategies
- Use generators for large data processing
- Profile memory usage for large operations
Security Guidelines:
- Validate all user inputs
- Use secure defaults for configuration
- Sanitize file paths and names
- Handle sensitive data appropriately
VS Code Setup:
// .vscode/settings.json
{
"python.defaultInterpreterPath": "./.venv/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["tests"]
}Pre-commit Configuration:
# .pre-commit-config.yaml
repos:
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8# Benchmark specific operations
python -m pytest tests/benchmarks/ --benchmark-only
# Profile memory usage
python -m memory_profiler src/wog_dump/core/download.py
# CPU profiling
python -m cProfile -o profile.stats -m wog_dump.cli.main full-pipeline# Run integration tests with real network calls
pytest tests/integration/ --network
# Test with different Python versions using tox
tox
# Test cross-platform compatibility
docker run --rm -v $(pwd):/app python:3.12-alpine /app/scripts/test.sh-
Ensure CI Passes
- All tests pass
- Code style checks pass
- Type checking passes
-
Update Documentation
- README if user-facing changes
- Docstrings for new functions
- CHANGELOG.md entry
-
Review Checklist
- Code follows project conventions
- Tests cover new functionality
- No breaking changes (or properly documented)
- Performance considerations addressed
-
Get Reviews
- Request review from maintainers
- Address feedback promptly
- Be open to suggestions
For maintainers:
-
Version Bump
- Update version in
pyproject.toml - Update version in
src/wog_dump/__init__.py
- Update version in
-
Update Changelog
- Add release notes
- List all changes since last release
-
Create Release
- Tag release:
git tag v2.3.2 - Push tags:
git push --tags - Create GitHub release
- Tag release:
- Discussions: Use GitHub Discussions for questions
- Issues: Create issues for bugs and feature requests
- Email: Contact maintainers for sensitive matters
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to WOG Dump! 🎉