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
enhancementlabel - ๐ 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
- Create a new file in
ai_trust_validator/analyzers/ - Inherit from
BaseAnalyzer - Implement
analyze(self, tree, code) -> List[Issue] - Add to
Validator._init_analyzers() - Add tests
- 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 #123orRelated 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
pytestbefore 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! ๐