Configuration
Upsilon can be configured through a pyproject.toml file in your project root.
Basic Configuration
[tool.upsilon]
model = "claude-3-haiku-20240307"
max_tokens = 2000
temperature = 0.1
api_key = "sk-your-anthropic-api-key-here" # Optional: can use ANTHROPIC_API_KEY env var instead
API Key Configuration
You can set your Anthropic API key in two ways:
-
Configuration file (recommended for local development):
[tool.upsilon]
api_key = "sk-your-api-key-here" -
Environment variable (recommended for CI/CD):
export ANTHROPIC_API_KEY="sk-your-api-key-here"
If both are set, the config file takes precedence.
Built-in Tools
Configure the built-in analysis tools:
[tool.upsilon.builtin-tools]
spell_check = { enabled = true, language = "en" }
syntax_check = { enabled = true }
import_analysis = { enabled = true }
Available Options
- spell_check: Detects common typos in code comments and strings
language: Language for spell checking (default: "en")
- syntax_check: Basic syntax validation using language compilers
- import_analysis: Basic import pattern checking
Rules Configuration
[tool.upsilon.rules]
check_typos = true
check_logic = true
check_security = true # Enables external tools (mypy, ruff, compilers)
check_style = true
check_imports = true
External Tools
External tools are automatically detected and enabled when available. These include:
- mypy: Python type checking
- ruff: Python linting and formatting
- python compiler: Python syntax validation
- julia compiler: Julia syntax validation
- rustc: Rust compilation checking
- go build: Go compilation checking
- eslint: JavaScript/TypeScript linting
Prompt Customization
Customize the AI prompts for code review:
[tool.upsilon.prompts]
system_prompt = """You are an expert code reviewer..."""
review_prompt = """Please review the following {language} code..."""
tool_selection_prompt = """Given the following tools..."""
summary_prompt = """Based on the analysis results..."""
Prompt Placeholders
Available placeholders in prompts:
{language}: Programming language{file_path}: File path being reviewed{content}: Code content
Ignore Patterns
Specify files and patterns to ignore:
[tool.upsilon]
ignore_patterns = [
"*.min.js",
"*.bundle.js",
"node_modules/*",
".git/*",
"__pycache__/*"
]
Environment Variables
ANTHROPIC_API_KEY: Required when using real Claude API (not in mock mode)
Example Configuration
[tool.upsilon]
model = "claude-3-haiku-20240307"
max_tokens = 2000
temperature = 0.1
[tool.upsilon.builtin-tools]
spell_check = { enabled = true, language = "en" }
syntax_check = { enabled = true }
import_analysis = { enabled = true }
[tool.upsilon.rules]
check_typos = true
check_logic = true
check_security = true
check_style = true
check_imports = true
ignore_patterns = [
"*.min.js",
"node_modules/*",
".git/*"
]
[tool.upsilon.prompts]
system_prompt = """You are an expert code reviewer focusing on code quality, bugs, and best practices."""