Thank you for your interest in contributing to Dev API Vault! This document provides guidelines and information for contributors.
- Fork the repository
- Clone your fork locally
- Create a new branch for your feature
- Make your changes
- Test your changes
- Submit a pull request
- Python 3.9 or higher
- Git
- A code editor (VS Code recommended)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Dev_Api_Vault.git
cd Dev_Api_Vault
# Set up virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies (including dev dependencies)
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
# Download NLTK data
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"- Use the bug report template
- Include steps to reproduce
- Provide system information
- Add relevant logs or screenshots
- Use the feature request template
- Explain the use case
- Provide examples if possible
- Consider implementation complexity
- Follow the coding standards below
- Add tests for new features
- Update documentation
- Ensure all tests pass
- Follow PEP 8 style guide
- Use type hints for all functions
- Maximum line length: 88 characters (Black formatter)
- Use meaningful variable names
# Example function structure
from typing import Optional
def process_text(
text: str,
max_length: Optional[int] = None
) -> dict[str, str]:
"""
Process text input and return formatted result.
Args:
text: Input text to process
max_length: Optional maximum length limit
Returns:
Dictionary containing processed text and metadata
Raises:
ValueError: If text is empty or invalid
"""
if not text.strip():
raise ValueError("Text cannot be empty")
# Implementation here
return {"processed_text": text, "length": len(text)}- Use RESTful conventions
- Include comprehensive error handling
- Provide clear response schemas
- Add input validation
- Maintain 90%+ test coverage
- Test both success and error cases
- Include integration tests for APIs
# Run all tests
pytest
# Run with coverage
pytest --cov=app --cov-report=html
# Run specific test categories
pytest -m "unit" # Unit tests only
pytest -m "integration" # Integration tests only# Example test structure
import pytest
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_qr_code_generation():
"""Test QR code generation with valid input."""
response = client.post(
"/qr-code",
json={"text": "Hello World"}
)
assert response.status_code == 200
assert "qr_code_base64" in response.json()
def test_qr_code_empty_text():
"""Test QR code generation with empty text."""
response = client.post(
"/qr-code",
json={"text": ""}
)
assert response.status_code == 422- Add docstrings to all functions and classes
- Use Google-style docstrings
- Include type hints
- Document complex algorithms
- Update OpenAPI schemas for new endpoints
- Add example requests/responses
- Include error code documentation
- All tests pass locally
- Code follows style guidelines
- Documentation is updated
- No merge conflicts with main branch
- Use the provided PR template
- Link related issues
- Describe changes clearly
- Include screenshots for UI changes
- Automated checks must pass
- Code review by maintainers
- Testing in staging environment
- Approval and merge
Use Conventional Commits format:
type(scope): description
feat(api): add text summarization endpoint
fix(qr): handle empty string input gracefully
docs(readme): update installation instructions
test(regex): add edge case tests
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringstyle: Formatting changesci: CI/CD changes
- DO NOT open public issues for security vulnerabilities
- Email security issues to: [security@yourproject.com]
- Include detailed steps to reproduce
- Allow reasonable time for fixes before disclosure
- Validate all inputs
- Sanitize user data
- Use parameterized queries
- Implement proper authentication
- Follow OWASP guidelines
Contributors are recognized in:
- README.md contributors section
- CHANGELOG.md release notes
- GitHub releases acknowledgments
- GitHub Discussions for general questions
- GitHub Issues for bugs and features
- Discord/Slack for real-time chat (if available)
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this code.
Thank you for contributing to Dev API Vault! π