First off, thank you for considering contributing to Discord Vector DB! It's people like you that make this project better for everyone.
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 to the project maintainers.
-
Fork the repository
-
Clone your fork locally:
git clone https://github.com/yourusername/discord_vector_db.git cd discord_vector_db -
Set up a virtual environment:
python -m venv venv # On Windows venv\Scripts\activate # On Unix or MacOS source venv/bin/activate
-
Install dependencies:
pip install -e ".[dev]"
We recommend using Visual Studio Code with the following extensions:
- Python
- Pylance or Pyright (for type checking)
- Ruff (for linting)
The repository includes configuration files for:
.vscode/settings.json- Editor settingsmypy.ini- MyPy configurationpyproject.toml- Project configuration including Ruff rules
This project uses both mypy and Pyright/Pylance for type checking. All code should have proper type annotations.
Type stubs for external libraries are provided in the typings/ directory. These stubs ensure proper type checking with libraries that may not have their own type definitions.
Important rules:
- All function parameters and return values should be properly typed
- Use
Optional[Type]for values that could beNone - When working with external libraries without type stubs, add appropriate
# type: ignorecomments - Use the helper functions in
discord_retriever/cli.pywhen working with typer to ensure correct typing
This project follows PEP 8 style guidelines along with additional rules:
-
Import Order:
- Standard library imports first
- Related third-party imports
- Local application/library specific imports
-
String Formatting:
- Use f-strings for string formatting (
f"Hello {name}")
- Use f-strings for string formatting (
-
Type Annotations:
- Follow PEP 484 for type hints
- Use type annotations for all function parameters and return values
-
Documentation:
- All modules, classes, and functions should have docstrings
- Follow Google's Python Style Guide for docstring format
-
Error Handling:
- Use specific exception types
- Provide meaningful error messages
-
Linting:
- Code must pass all Ruff checks
- Run
ruff check .before submitting a pull request
- Ensure your code follows the coding standards and passes all type checks
- Update the documentation if necessary
- Add tests for any new functionality
- Submit the pull request with a clear description of the changes
When reporting issues, please include:
- Your operating system name and version
- Python version
- Detailed steps to reproduce the issue
- Expected behavior
- Actual behavior
- Any error messages (including stack traces)
For feature requests, clearly describe the proposed functionality and its use cases.
Thank you for contributing to Discord Vector DB!