diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 064c2970..4c07c8d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,306 +1,262 @@ # Contributing to Semantica -Thank you for your interest in contributing to Semantica! This document provides guidelines and instructions for contributing to the project. +Thank you for your interest in contributing! Every contribution, no matter how small, is valuable. ๐ŸŽ‰ -## Table of Contents +> **New to contributing?** Start with a [`good first issue`](https://github.com/Hawksight-AI/semantica/labels/good%20first%20issue) or join our [Discord](https://discord.gg/vqRt2qbx) community. -- [Code of Conduct](#code-of-conduct) -- [Getting Started](#getting-started) -- [Development Setup](#development-setup) -- [Code Style Guidelines](#code-style-guidelines) -- [Testing Requirements](#testing-requirements) -- [Commit Message Conventions](#commit-message-conventions) -- [Pull Request Process](#pull-request-process) -- [Documentation Standards](#documentation-standards) -- [Types of Contributions](#types-of-contributions) -- [Getting Help](#getting-help) +--- -## Code of Conduct +## ๐Ÿš€ Quick Start -This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers. +1. Find a [`good first issue`](https://github.com/Hawksight-AI/semantica/labels/good%20first%20issue) +2. Fork & clone the repository +3. Make your changes +4. Submit a pull request! -## Getting Started +**Need help?** Join [Discord](https://discord.gg/vqRt2qbx) or [GitHub Discussions](https://github.com/Hawksight-AI/semantica/discussions) -1. **Fork the repository** on GitHub -2. **Clone your fork** locally: - ```bash - git clone https://github.com/your-username/semantica.git - cd semantica - ``` -3. **Add the upstream remote**: - ```bash - git remote add upstream https://github.com/Hawksight-AI/semantica.git - ``` +--- -## Development Setup +## ๐ŸŽฏ Ways to Contribute -### Prerequisites +### ๐Ÿ’ป Code -- Python 3.8 or higher (3.9+ recommended) -- pip package manager -- Git +**What you can do:** +- Fix bugs +- Add new features +- Improve code quality (add type hints, docstrings, improve error messages) +- Optimize performance -### Installation +**Where:** `semantica/` directory -1. **Create a virtual environment** (recommended): - ```bash - python -m venv venv - source venv/bin/activate # On Windows: venv\Scripts\activate - ``` +**Good first issues:** Add docstrings, type hints, or improve error messages -2. **Install the project in editable mode with dev dependencies**: - ```bash - pip install -e ".[dev]" - ``` +--- -3. **Install pre-commit hooks**: - ```bash - pre-commit install - ``` +### ๐Ÿ“ Documentation -### Verify Installation +**What you can do:** +- Fix typos and grammar errors +- Improve clarity and readability +- Add code examples and tutorials +- Create new cookbook notebooks +- Improve API documentation (docstrings) +- Create troubleshooting guides +- Update installation instructions +- Add missing documentation + +**Where:** `README.md`, `docs/`, `cookbook/`, docstrings in code + +**Good first issues:** Fix typos, add examples, create cookbook tutorials, improve docstrings + +**Documentation formatting:** +- Use clear, concise language +- Include code examples where helpful +- Follow markdown best practices +- Use proper headings hierarchy +- Add links to related sections +- Include screenshots for UI-related docs + +--- + +### ๐Ÿงช Testing + +**What you can do:** +- Add unit tests +- Improve test coverage +- Add integration tests + +**Where:** `tests/` directory + +**Good first issues:** Add tests for specific functions or classes + +--- + +### ๐Ÿ› Bug Reports + +**What:** Report bugs you find + +**How:** Use the [bug report template](https://github.com/Hawksight-AI/semantica/issues/new?template=bug_report.md) + +**Include:** Description, steps to reproduce, expected vs actual behavior, environment details + +--- + +### ๐Ÿ’ก Feature Requests + +**What:** Suggest new features or improvements + +**How:** Use the [feature request template](https://github.com/Hawksight-AI/semantica/issues/new?template=feature_request.md) + +**Include:** Problem statement, proposed solution, use cases + +--- + +### ๐ŸŽจ Cookbook & Examples + +**What:** Create tutorials and examples + +**Where:** `cookbook/` directory + +**Examples:** Create new notebooks, add examples, improve existing tutorials + +--- + +### ๐Ÿ’ฌ Community Support + +**What:** Help others in the community + +**Where:** [Discord](https://discord.gg/vqRt2qbx), [GitHub Discussions](https://github.com/Hawksight-AI/semantica/discussions) + +**Examples:** Answer questions, review PRs, share your projects + +--- + +### ๐ŸŽ“ Educational Content + +**What:** Create educational materials + +**Examples:** Blog posts, video tutorials, talks, workshops, case studies + +--- + +### ๐Ÿ”ง Other Contributions + +- **Design & Graphics:** Logos, diagrams, visualizations +- **Tools & Integrations:** CLI tools, integrations with other frameworks +- **Infrastructure:** CI/CD improvements, Docker optimization +- **Security:** Report security vulnerabilities (privately) + +--- + +## ๐Ÿ“‹ Getting Started + +### 1. Fork & Clone ```bash -python -c "import semantica; print(semantica.__version__)" -pytest --version -black --version +git clone https://github.com/your-username/semantica.git +cd semantica +git remote add upstream https://github.com/Hawksight-AI/semantica.git ``` -## Code Style Guidelines - -We use several tools to maintain code quality and consistency: - -### Formatting - -- **Black**: Code formatting (line length: 88) - ```bash - black semantica/ - ``` - -- **isort**: Import sorting - ```bash - isort semantica/ - ``` - -### Linting - -- **flake8**: Style guide enforcement - ```bash - flake8 semantica/ - ``` - -- **mypy**: Static type checking - ```bash - mypy semantica/ - ``` - -### Running All Checks +### 2. Set Up Environment ```bash -# Format code -black semantica/ tests/ +# Create virtual environment +python -m venv venv +source venv/bin/activate # Windows: venv\Scripts\activate -# Sort imports -isort semantica/ tests/ +# Install dev dependencies +pip install -e ".[dev]" -# Lint -flake8 semantica/ tests/ - -# Type check -mypy semantica/ +# Install pre-commit hooks (optional) +pre-commit install ``` -Or use pre-commit hooks (automatically runs on commit): -```bash -pre-commit run --all-files -``` - -## Testing Requirements - -### Running Tests +### 3. Create Branch ```bash -# Run all tests -pytest - -# Run with coverage -pytest --cov=semantica --cov-report=html - -# Run specific test file -pytest tests/test_specific.py - -# Run with verbose output -pytest -v +git checkout -b feature/your-feature-name +# or +git checkout -b fix/bug-description ``` -### Test Coverage +### 4. Make Changes -- Minimum coverage: **80%** -- Critical modules: **90%+** -- Coverage reports are generated in `htmlcov/` +- Follow code style (see below) +- Add tests for new features +- Update documentation -### Writing Tests +### 5. Run Checks -- Follow pytest conventions -- Use descriptive test names -- Include docstrings for complex tests -- Test both success and failure cases -- Use fixtures for common setup - -Example: -```python -def test_entity_extraction(): - """Test basic entity extraction functionality.""" - from semantica.semantic_extract import NamedEntityRecognizer - - ner = NamedEntityRecognizer() - entities = ner.extract("Apple Inc. was founded by Steve Jobs.") - - assert len(entities) > 0 - assert any(e.text == "Apple Inc." for e in entities) +```bash +pytest # Run tests +black semantica/ tests/ # Format code +isort semantica/ tests/ # Sort imports +flake8 semantica/ tests/ # Lint ``` -## Commit Message Conventions +Or use pre-commit hooks: `pre-commit run --all-files` -We follow [Conventional Commits](https://www.conventionalcommits.org/) specification: +### 6. Commit & Push -### Format - -``` -(): - - - -