Skip to content

Contributing to TrustBench

Thank you for your interest in contributing to TrustBench! We welcome contributions from researchers, engineers, and community members.

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.

Development Setup

  1. Clone the repository:

    git clone https://github.com/Uni-Creator/trustbench.git
    cd trustbench
    

  2. Install with development dependencies: TrustBench uses uv or standard pip/virtualenv:

    uv venv
    source .venv/bin/activate
    uv pip install -e ".[all]"
    

  3. Verify the test suite:

    pytest
    

  4. Verify linting:

    ruff check .
    

  5. Build documentation locally:

    uv run --group docs mkdocs serve
    

Pull Request Guidelines

  1. Create a topic branch:
    git checkout -b feature/your-feature-name
    
  2. Keep the core small and framework-agnostic:
  3. Never import optional frameworks (torch, tensorflow, jax, onnxruntime, plotly) at top-level core modules (trustbench.core).
  4. Use dynamic imports and verify with import isolation tests.
  5. Add unit tests:
  6. Place tests under tests/unit/ or tests/integration/.
  7. Ensure pytest passes with 100% clean exit.
  8. Adhere to Code Style:
  9. Format and lint using ruff check --fix ..
  10. Update Documentation:
  11. If adding a new metric, adapter, or configuration parameter, update relevant documents in docs/ and README.md.
  12. Submit PR:
  13. Provide a clear summary of changes, rationale, and test results using the pull request template.

Reporting Bugs

Please use the Bug Report Template and include: - Operating system and Python version - TrustBench version (trustbench version) - Minimal reproducible example - Full stack trace