Spaces:
Sleeping
Sleeping
File size: 3,317 Bytes
f866820 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | # Contributing to RAG Document Assistant
Thank you for your interest in contributing to the RAG Document Assistant! This document provides guidelines and information to help you contribute effectively.
## Table of Contents
- [Getting Started](#getting-started)
- [Development Setup](#development-setup)
- [Code Style](#code-style)
- [Testing](#testing)
- [Submitting Changes](#submitting-changes)
- [Reporting Issues](#reporting-issues)
## Getting Started
1. Fork the repository on GitHub
2. Clone your fork locally
3. Create a new branch for your feature or bug fix
4. Make your changes
5. Submit a pull request
## Development Setup
### Prerequisites
- Python 3.8 or higher
- pip (package installer for Python)
### Installation
```bash
# Clone the repository
git clone https://github.com/your-username/RAG-document-assistant.git
cd RAG-document-assistant
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install -r requirements-dev.txt # If available
# Or install manually:
pip install pytest black flake8 mypy
```
## Code Style
We follow these coding standards:
### Python Style Guide
- Follow [PEP 8](https://pep8.org/) style guide
- Use 4 spaces for indentation (no tabs)
- Line length should not exceed 88 characters
- Use meaningful variable and function names
- Write docstrings for all public functions and classes
### Formatting
We use Black for code formatting:
```bash
# Format code
black src/ tests/
# Check formatting
black --check src/ tests/
```
### Linting
We use Flake8 for linting:
```bash
flake8 src/ tests/
```
### Type Checking
We use MyPy for static type checking:
```bash
mypy src/
```
## Testing
### Running Tests
```bash
# Run all tests
pytest
# Run tests with coverage
pytest --cov=src tests/
# Run specific test file
pytest tests/test_retrieval.py
```
### Writing Tests
- Place test files in the `tests/` directory
- Follow the naming convention: `test_*.py`
- Use descriptive test function names
- Include both positive and negative test cases
- Test edge cases and error conditions
## Submitting Changes
1. Ensure your code follows the style guidelines
2. Run all tests and ensure they pass
3. Add tests for new functionality
4. Update documentation as needed
5. Commit your changes with a clear, descriptive commit message
6. Push to your fork
7. Submit a pull request to the main repository
### Pull Request Guidelines
- Include a clear title and description
- Reference any related issues
- Keep changes focused and atomic
- Ensure all CI checks pass
- Be responsive to feedback during review
## Reporting Issues
If you find a bug or have a feature request, please open an issue on GitHub with:
- A clear, descriptive title
- Detailed steps to reproduce the issue
- Expected vs. actual behavior
- Screenshots or code examples if applicable
- Information about your environment (Python version, OS, etc.)
## Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
## Questions?
If you have any questions about contributing, feel free to open an issue or contact the maintainers. |