lint
Analyze SQL models for potential issues.
Runs SQLFluff-style lint rules against your SQL models and reports any violations found. Rules can be configured in leapsql.yaml.
Output adapts to environment:
- Terminal: Styled output with colors
- Piped/Scripted: Markdown format
- JSON: Machine-readable format
Usage
bash
leapsql lint [path] [flags]Options
| Option | Short | Default | Description |
|---|---|---|---|
--disable | [] | Rule IDs to disable | |
--format | -f | Output format: text, json | |
--rule | [] | Run only specific rules | |
--severity | warning | Minimum severity: error, warning, info, hint | |
--skip-project | false | Skip project health linting | |
--verbose | -v | false | Show rule documentation with violations |
Global Options
| Option | Short | Default | Description |
|---|---|---|---|
--config | config file (default: ./leapsql.yaml) | ||
--database | Path to DuckDB database (empty for in-memory) | ||
--env | Environment name | ||
--macros-dir | Path to macros directory | ||
--models-dir | Path to models directory | ||
--output | -o | Output format (auto|text|markdown|json) | |
--project-dir | -C | Project root directory (auto-detected from models-dir or config file location) | |
--seeds-dir | Path to seeds directory | ||
--state | Path to state database | ||
--target | -t | Target environment to use (e.g., dev, staging, prod) |
Examples
bash
# Lint all models
leapsql lint
# Lint specific path
leapsql lint ./models/staging
# Output as JSON
leapsql lint --format json
# Disable specific rules
leapsql lint --disable AM01,ST01
# Only report errors (ignore warnings/hints)
leapsql lint --severity error
# Show rule documentation with violations
leapsql lint --verbose