First off, thank you for considering contributing to ragctl! 🎉
It's people like you that make ragctl a great tool for the community. We welcome contributions from everyone, whether you're fixing a typo, adding a feature, or improving documentation.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Coding Standards
- Testing
- Commit Messages
- Documentation
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior by opening an issue or contacting the maintainers.
Before creating bug reports, please check the issue tracker to see if the problem has already been reported. When you create a bug report, include as many details as possible using our bug report template.
Good bug reports include:
- A clear and descriptive title
- Steps to reproduce the problem
- Expected vs. actual behavior
- ragctl version (
ragctl --version) - Python version and operating system
- Sample files or error logs if applicable
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the proposed functionality
- Explain why this enhancement would be useful
- List any alternative solutions you've considered
Unsure where to begin? Look for issues labeled:
good first issue- Simple issues perfect for newcomershelp wanted- Issues where we'd especially appreciate contributionsdocumentation- Improvements to docs are always welcome!
- Fork the repository and create your branch from
main - Make your changes following our coding standards
- Add tests if you've added functionality
- Update documentation if you've changed APIs or behavior
- Ensure tests pass by running
make test - Run linters with
make lint - Submit your pull request
- Python 3.10 or higher
- pip and virtualenv
- Git
# Clone your fork
git
cd ragctl
# Create a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install development dependencies
make install-dev
# Install pre-commit hooks
make pre-commit-install
# Verify installation
ragctl --version
make testragctl/
├── src/ # Source code
│ ├── ragctl/ # Main package
│ │ ├── cli/ # CLI commands
│ │ ├── core/ # Core functionality
│ │ ├── ocr/ # OCR engines
│ │ ├── chunking/ # Text chunking
│ │ └── storage/ # Storage backends
├── tests/ # Test files
├── docs/ # Documentation
├── scripts/ # Utility scripts
└── pyproject.toml # Project configuration
We use automated tools to maintain code quality:
- Ruff: For linting and formatting
- Pre-commit hooks: Automatically run on commits
# Format code
make format
# Run linters
make lint
# Fix auto-fixable issues
ruff check --fix .- Follow PEP 8
- Use type hints for function signatures
- Maximum line length: 100 characters
- Use descriptive variable names
- Add docstrings for public functions and classes
from typing import Optional
def process_document(
file_path: str,
max_tokens: int = 400,
strategy: str = "semantic"
) -> list[dict]:
"""Process a document and return chunks.
Args:
file_path: Path to the document file
max_tokens: Maximum tokens per chunk
strategy: Chunking strategy to use
Returns:
List of chunk dictionaries with metadata
Raises:
FileNotFoundError: If file_path doesn't exist
ValueError: If strategy is invalid
"""
# Implementation
passWe maintain high test coverage to ensure reliability.
# Run all tests
make test
# Run specific test file
pytest tests/test_chunking.py
# Run with coverage report
make coverage
# Run tests in watch mode
pytest-watch- Place tests in
tests/directory - Name test files
test_*.py - Use descriptive test names:
test_should_chunk_document_into_semantic_parts - Use pytest fixtures for common setup
- Aim for >80% code coverage for new features
import pytest
from ragctl.chunking import SemanticChunker
def test_semantic_chunker_respects_max_tokens():
"""Semantic chunker should not exceed max_tokens."""
chunker = SemanticChunker(max_tokens=100)
text = "word " * 500 # 500 words
chunks = chunker.chunk(text)
for chunk in chunks:
assert chunk.token_count <= 100We follow Conventional Commits for clear history:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
feat(ocr): add support for PaddleOCR fallback
Implement automatic fallback to PaddleOCR when EasyOCR fails.
This improves reliability for complex document layouts.
Closes #123
fix(cli): handle missing config file gracefully
Previously crashed with FileNotFoundError. Now uses default
config and shows helpful warning message.
Fixes #456
Good documentation is crucial for adoption:
- Adding new features → Update relevant docs + add usage examples
- Changing APIs → Update API reference and migration guides
- Fixing bugs → Add troubleshooting entry if user-facing
- Configuration changes → Update config examples
- README.md: Quick start and overview
- docs/: Detailed guides and references
- Docstrings: In-code API documentation
- CHANGELOG.md: Keep updated with notable changes
- Be clear and concise
- Use examples liberally
- Assume readers are smart but unfamiliar with the project
- Use active voice: "Run the command" not "The command should be run"
- Check existing issues or create a new one to discuss your idea
- Fork and clone the repository
- Create a branch:
git checkout -b feature/your-feature-name - Make changes with good commit messages
- Add tests for your changes
- Run tests and linters:
make ci-all - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request with a clear description
- 💬 Discussions: Ask questions in GitHub Discussions
- 🐛 Issues: Report bugs or request features
- 📚 Documentation: Check docs/ for guides
Contributors are recognized in our README and releases. We appreciate all contributions, from code to documentation to bug reports!
Don't hesitate to ask! We're here to help:
- Open an issue with the
questionlabel - Start a discussion in GitHub Discussions
- Comment on relevant issues or pull requests
Thank you for contributing to ragctl! 🚀