AI-powered code quality analysis tool with support for multiple LLM providers and GitHub integration.
-
🧠 Multiple AI Providers
- OpenAI (GPT-4, GPT-3.5-turbo)
- Azure OpenAI
- Claude (claude-3-opus, claude-3-sonnet)
- DeepSeek (deepseek-coder)
-
🔍 Code Analysis
- Static analysis with Pylint
- AI-powered improvement suggestions
- Automatic fixes
- Code formatting
-
🌟 GitHub Integration
- Pull Request analysis
- Automatic comments
- Commit creation
- Code suggestions
-
💻 User-Friendly Interface
- Colored output
- Git-style diffs
- Interactive fix application
- Multi-language support
pip install ai-quality-ciSet up the required environment variables:
# OpenAI
export OPENAI_API_KEY="your-key"
# Azure OpenAI
export AZURE_OPENAI_KEY="your-key"
export AZURE_OPENAI_ENDPOINT="your-endpoint"
# GitHub
export GITHUB_TOKEN="your-token"Create a config.yaml file to customize settings:
provider:
name: openai # or azure, claude, deepseek
model: gpt-4 # provider-specific model
analysis:
ignore_patterns:
- "test_*.py"
- "setup.py"
pylint_config: "path/to/pylintrc"
output:
language: en # or pt-BR, es
human_readable: true# Analyze a file
ai-quality-ci review-files file.py
# Analyze a directory
ai-quality-ci review-files src/
# Ignore specific files
ai-quality-ci review-files . --ignore "test_*.py"
# Human-readable output
ai-quality-ci review-files src/ --human-readable# Analyze PR
ai-quality-ci review-pr username/repo 123
# Analyze PR with specific model
ai-quality-ci review-pr username/repo 123 --provider azure --model gpt-4| Option | Description | Default |
|---|---|---|
| --provider | AI provider | openai |
| --model | AI model | gpt-4 |
| --language | Output language (en, pt-BR) | en |
| --auto-apply | Apply fixes automatically | false |
| --show-fixes | Show suggested fix details | false |
| --human-readable | Use rich formatting for better readability | false |
| --recursive | Search files recursively | true |
| --ignore | Patterns to ignore (can use multiple) | - |
| --config | Configuration file | - |
When using --show-fixes, the tool shows corrections in git-diff format:
Fix #1: Add parameter typing
--- a/file.py
+++ b/file.py
@@ -1,5 +1,5 @@
-def process_data(data):
- result = []
+def process_data(data: List[Dict]) -> List[Dict]:
+ result: List[Dict] = []
for item in data:
# processing
return resultFor each fix you can:
- View title and description
- View proposed changes
- Choose to apply or not
- Generate commit automatically
- Standard Mode: Plain text output
- Human-Readable Mode (
--human-readable):- Colors and icons
- Rich formatting
- Colored diffs
- Friendly interaction
-
Manual (
--show-fixes):- Individual choice
- Separate commits
- Preview changes
-
Automatic (
--auto-apply --show-fixes):- All fixes
- Prior confirmation
- Automatic commits
⚠️ Note:--auto-applyrequires--show-fixes
# Clone repository
git clone https://github.com/username/ai-quality-ci
cd ai-quality-ci
# Install in development mode
pip install -e ".[dev]"# Run tests
pytest
# With coverage
pytest --cov=ai_quality_ciMIT License - See LICENSE for details.