Skip to content

Latest commit

 

History

History
143 lines (94 loc) · 4.31 KB

File metadata and controls

143 lines (94 loc) · 4.31 KB

Contributing to CTINexus

Thank you for your interest in contributing to CTINexus! We welcome contributions in various forms, including bug reports, feature requests, documentation improvements, and code contributions.

How to Contribute

🐛 Reporting Bugs

If you find a bug, please open an issue on our GitHub repository. Provide as much information as possible, including:

  • A clear and descriptive title.
  • Steps to reproduce the bug.
  • Expected and actual behavior.
  • Screenshots, logs, or code snippets, if applicable.
  • Environment details (OS, Python version, API provider).

💡 Suggesting Features

If you have an idea for a new feature or an improvement, please open an issue with the following details:

  • A clear and descriptive title.
  • A detailed description of the feature.
  • Any relevant use cases or examples.

📖 Improving Documentation

Good documentation is key to a successful project. If you find areas in our documentation that need improvement, feel free to submit a pull request. Here are some ways you can help:

  • Fix typos or grammatical errors.
  • Clarify confusing sections.
  • Add missing information.
  • Update CLI documentation or add examples.

Contributing Code

  1. Fork the Repository: Fork the repository to your own GitHub account.

  2. Clone the Fork: Clone your fork to your local machine:

    git clone https://github.com/YOUR-USERNAME/CTINexus
    cd CTINexus
  3. Create a virtual environment and install dependencies:

    python -m venv .venv
    source .venv/bin/activate  # On macOS/Linux
    # .venv\Scripts\activate    # On Windows
    
    pip install -e ".[dev]"
  4. Set up pre-commit hooks:

    pre-commit install

    This installs git hooks that automatically run code quality checks before each commit.

  5. Configure environment variables:

    cp .env.example .env
    # Edit .env with your API keys (OpenAI, Gemini, AWS)
    # OR set up Ollama for local models
  6. Create a Branch: Create a new branch for your work:

    git checkout -b feature-name
  7. Make Changes: Make your changes in your branch.

  8. Run tests: Run the test suite to ensure your changes don't break existing functionality:

    # Run all tests
    uv run pytest tests/ -v
    
    # Run with coverage report
    uv run pytest tests/ --cov=ctinexus --cov-report=term-missing

    All tests must pass before submitting a pull request. If you've added new features, include tests for them.

  9. Format and Lint your code: Before committing, ensure your code follows our style guidelines:

    pre-commit run --all-files
  10. Test your changes manually: Ensure your changes work correctly in practice:

    ctinexus
  11. Commit Changes: Commit your changes with a descriptive commit message. Use a category to indicate the type of change. Common categories include:

    • feat: New feature
    • fix: Bug fix
    • docs: Documentation changes
    • refactor: Code refactoring
    • test: Adding or updating tests
    • chore: Maintenance tasks

    Example:

    git commit -m "feat: add support for new AI provider"

    If pre-commit hooks are installed, they will automatically run when you commit. If any checks fail, fix the issues and commit again.

  12. Push to Fork: Push your changes to your forked repository:

    git push origin feature-name
  13. Open a Pull Request: Open a pull request from your fork to the main repository. Include a detailed description of your changes and any related issues.

Automated Checks

When you open a pull request, GitHub Actions will automatically run code quality checks. These checks must pass before your PR can be merged. If they fail:

  1. Review the error messages in the GitHub Actions log
  2. Run the checks locally: ruff check . --fix && ruff format .
  3. Commit and push the fixes
  4. The checks will run again automatically

Code Quality & Style

Please follow the code style used in the project. We use PEP 8 for Python code.

Review Process

All pull requests are reviewed by our maintainers. We strive to provide feedback promptly, typically within a few days. Thank you for helping to improve CTINexus.