This guide covers how to upgrade your .altimate.yml from v1 (built-in regex rules) to v2 (powered by altimate-code check).
| Aspect | v1 | v2 |
|---|---|---|
| Rule engine | Built-in regex patterns (19 rules) | altimate-code check CLI (40+ checks across 7 categories) |
| SQL validation | Not available | DataFusion-based SQL parsing and validation |
| Safety checks | Basic pattern matching | AST-aware SQL injection and destructive operation detection |
| Policy enforcement | Not available | Custom guardrails via .altimate-policy.yml |
| PII detection | Column name regex matching | Combined column, literal, and comment scanning |
| Semantic analysis | Not available | Schema-aware join correctness, type compatibility checks |
| SQL grading | Not available | Quality scoring with letter grades (A-F) |
| Issue categorization | Flat list | Grouped by category (lint/, safety/, pii/, etc.) |
None. The v2 integration is fully backward compatible:
- If you set
version: 2but thealtimate-codeCLI is not installed, the action automatically falls back to the v1 regex engine. - If you omit
versionentirely, the action runs in v1 mode. - All existing action inputs (
mode,sql_review,fail_on, etc.) continue to work unchanged.
- Lint checks (L001-L026) -- 26 SQL lint rules covering correctness, performance, style, and safety. Superset of the v1 regex rules with AST-level accuracy.
- SQL validation -- Parse SQL against the DataFusion engine. Catch syntax errors before they hit your warehouse.
- Safety analysis -- Detect SQL injection vectors, destructive statements, and privilege escalation patterns.
- Policy enforcement -- Define organizational guardrails (block
SELECT *in production, requireLIMIT, etc.) in a separate policy file. - PII scanning -- Detect PII in column names, string literals, and comments across 15 categories.
- Semantic checks -- Schema-aware analysis: incorrect join conditions, type mismatches, missing columns. Requires schema resolution.
- SQL grading -- Quality score and letter grade for each file analyzed.
Change (or add) the version field at the top of .altimate.yml:
# Before (v1)
version: 1
# After (v2)
version: 2v1 uses a flat sql_review.rules map. v2 uses a checks map where each key is a check category:
# Before (v1)
sql_review:
enabled: true
rules:
select_star:
enabled: true
severity: warning
cartesian_join:
enabled: true
severity: error
# After (v2)
checks:
lint:
enabled: true
# disabled_rules:
# - L001 # select_star
# severity_overrides:
# L002: error # cartesian_join
safety:
enabled: true
validate:
enabled: true# Before (v1)
pii_detection:
enabled: true
categories: [email, ssn, phone]
# After (v2)
checks:
pii:
enabled: true
categories:
- email
- ssn
- phoneIf your repository contains a dbt project and you want semantic checks:
schema:
source: dbt
dbt:
manifest_path: target/manifest.json
checks:
semantic:
enabled: truechecks:
policy:
enabled: true
file: .altimate-policy.ymlSee the Policy Guide for policy file format and examples.
The v2 checks require the altimate-code CLI to be available in your GitHub Actions runner. Add an installation step before the review action:
steps:
- uses: actions/checkout@v4
- uses: AltimateAI/setup-altimate-code@v1 # Install the CLI
- uses: AltimateAI/altimate-code-actions@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}If the CLI is not installed, the action falls back to v1 rules automatically.
version: 1
sql_review:
enabled: true
severity_threshold: warning
rules:
select_star:
enabled: true
severity: warning
cartesian_join:
enabled: true
severity: error
missing_where_clause:
enabled: true
severity: warning
include:
- "models/**/*.sql"
exclude:
- "models/staging/legacy/**"
pii_detection:
enabled: true
categories: [email, ssn, phone]
comment:
mode: single
max_issues_shown: 20
dialect: autoversion: 2
checks:
lint:
enabled: true
severity_overrides:
L002: error # cartesian_join
validate:
enabled: true
safety:
enabled: true
policy:
enabled: false
pii:
enabled: true
categories: [email, ssn, phone]
semantic:
enabled: false
grade:
enabled: false
comment:
mode: single
max_issues_shown: 20
dialect: autoAfter updating your config, open a PR that modifies a .sql file. The PR comment will show category-grouped issues (e.g., "Lint", "Safety", "PII") instead of the flat v1 issue list. If you see category subsection headers in the comment, v2 is active.
To verify locally:
altimate-code check models/my_model.sql --format json --checks lint,safetyIf this command runs successfully, the CLI integration is working.