Contributing to AI Code Trust Validator

March 24, 2026 ยท View on GitHub

Thanks for your interest in contributing! ๐ŸŽ‰

Ways to Contribute

  • ๐Ÿ› Report bugs โ€” Open an issue with details
  • ๐Ÿ’ก Suggest features โ€” Open an issue with the enhancement label
  • ๐Ÿ“ Improve docs โ€” Better documentation helps everyone
  • ๐Ÿ”ง Submit PRs โ€” Fix bugs, add features, improve code

Development Setup

# Clone the repo
git clone https://github.com/rudra496/ai-code-trust-validator.git
cd ai-code-trust-validator

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .

# Format code
black .

Project Structure

ai-code-trust-validator/
โ”œโ”€โ”€ ai_trust_validator/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package exports
โ”‚   โ”œโ”€โ”€ cli.py               # CLI commands
โ”‚   โ”œโ”€โ”€ config.py            # Configuration handling
โ”‚   โ”œโ”€โ”€ validator.py         # Main validation logic
โ”‚   โ””โ”€โ”€ analyzers/
โ”‚       โ”œโ”€โ”€ __init__.py      # Base analyzer
โ”‚       โ”œโ”€โ”€ security.py      # Security analysis
โ”‚       โ”œโ”€โ”€ hallucination.py # Hallucination detection
โ”‚       โ”œโ”€โ”€ logic.py         # Logic errors
โ”‚       โ””โ”€โ”€ best_practices.py# Best practices
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_validator.py    # Test suite
โ”œโ”€โ”€ pyproject.toml           # Package config
โ””โ”€โ”€ README.md                # Documentation

Adding a New Analyzer

  1. Create a new file in ai_trust_validator/analyzers/
  2. Inherit from BaseAnalyzer
  3. Implement analyze(self, tree, code) -> List[Issue]
  4. Add to Validator._init_analyzers()
  5. Add tests
  6. Update docs

Example:

from ai_trust_validator.analyzers import BaseAnalyzer
from ai_trust_validator.validator import Issue

class MyAnalyzer(BaseAnalyzer):
    base_score = 100

    def analyze(self, tree, code):
        issues = []
        # Your analysis logic here
        return issues

Commit Guidelines

  • Use clear, descriptive commit messages
  • Reference issues: Fixes #123 or Related to #456
  • Keep commits focused and atomic

Code Style

  • Follow PEP 8
  • Use type hints
  • Add docstrings to public functions
  • Keep functions under 50 lines

Testing

  • Write tests for new features
  • Run pytest before submitting PRs
  • Aim for >80% coverage on new code

Questions?

Open an issue with the question label.


Thanks for helping make AI-generated code more trustworthy! ๐Ÿš€