Contributing to CCGO¶
Thank you for your interest in contributing to CCGO! This guide will help you get started.
Ways to Contribute¶
- Report Bugs: File issues with detailed reproduction steps
- Suggest Features: Propose new features or improvements
- Write Documentation: Improve docs, add examples, fix typos
- Submit Code: Fix bugs, implement features, improve performance
- Share Feedback: Tell us about your experience using CCGO
Getting Started¶
1. Fork and Clone¶
# Fork the repository on GitHub
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/ccgo.git
cd ccgo
2. Set Up Development Environment¶
# Install Python dependencies
cd ccgo
pip3 install -e ".[dev]"
# Or install Rust version
cd ccgo-rs
cargo build
3. Create a Branch¶
Development Workflow¶
For Python CLI (/ccgo/)¶
cd ccgo
# Install in editable mode
pip3 install -e .
# Run tests
pytest tests/
# Run linters
flake8 .
black .
mypy .
# Test CLI command
ccgo --version
For Rust CLI (/ccgo-rs/)¶
cd ccgo-rs
# Build
cargo build
# Run tests
cargo test
# Run linters
cargo clippy
cargo fmt
# Install locally for testing
cargo install --path .
For Gradle Plugins (/ccgo-gradle-plugins/)¶
cd ccgo-gradle-plugins
# Build plugins
./gradlew build
# Publish to Maven Local for testing
./gradlew publishToMavenLocal
# Test in a project
# Add mavenLocal() to pluginManagement.repositories
For Templates (/ccgo-template/)¶
# Test template generation
copier copy ccgo-template/ test-output/ --vcs-ref HEAD --trust
# Test in existing project
cd existing-project
copier update --vcs-ref HEAD
Code Style¶
Python¶
- Follow PEP 8
- Use Black for formatting
- Use type hints where possible
- Write docstrings for public APIs
Rust¶
- Follow Rust API Guidelines
- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Write doc comments for public items
Commit Messages¶
Follow Conventional Commits:
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
Examples:
feat(build): add support for RISC-V architecture
fix(android): resolve AAR packaging issue with native libs
docs(readme): update installation instructions
Testing¶
Write Tests¶
- Add unit tests for new functionality
- Add integration tests for user-facing features
- Ensure tests pass on all supported platforms
- Aim for >80% code coverage
Run Tests¶
# Python
pytest tests/ -v
# Rust
cargo test
# Integration tests
cd ccgo-now/ccgonow
ccgo build android --arch arm64-v8a
ccgo test
Documentation¶
Update Documentation¶
- Add docstrings/doc comments for new APIs
- Update README.md if adding user-facing features
- Update relevant docs in
/docs/directory - Add examples for complex features
Build Documentation Locally¶
# Install MkDocs
pip install -r docs/requirements.txt
# Serve documentation locally
mkdocs serve
# Open http://localhost:8000 in your browser
Pull Request Process¶
1. Prepare Your PR¶
- Ensure all tests pass
- Update documentation
- Add entry to CHANGELOG.md (if applicable)
- Rebase on latest main branch
2. Submit PR¶
- Push your branch to your fork
- Open a Pull Request on GitHub
- Fill out the PR template completely
- Link related issues using #issue_number
3. Code Review¶
- Address reviewer feedback
- Keep commits clean and atomic
- Be responsive to questions/suggestions
- CI checks must pass
4. Merge¶
- Squash commits if requested
- Maintainer will merge when ready
- Delete your branch after merge
Issue Guidelines¶
Reporting Bugs¶
Include:
- CCGO version (ccgo --version)
- Operating system and version
- Steps to reproduce
- Expected vs actual behavior
- Error messages and logs
- Minimal reproduction case if possible
Requesting Features¶
Include: - Clear description of the feature - Use cases and benefits - Proposed API/interface (if applicable) - Alternatives you've considered
Community Guidelines¶
- Be respectful and inclusive
- Follow our Code of Conduct
- Help others in discussions
- Give constructive feedback
- Celebrate contributions
Getting Help¶
- Check existing documentation
- Search existing issues
- Ask in GitHub Discussions
- Join our community chat (coming soon)
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to CCGO! 🎉