rules
List all available lint rules with their documentation.
Rules are organized by type (SQL or project) and group (e.g., aliasing, modeling). Use --verbose to see full documentation including examples and fix guidance.
Output adapts to environment:
- Terminal: Styled output with colors
- Piped/Scripted: Markdown format
- JSON: Machine-readable format
Usage
bash
leapsql rules [rule-id] [flags]Options
| Option | Short | Default | Description |
|---|---|---|---|
--format | -f | Output format: text, json, markdown | |
--group | -g | Filter by group | |
--type | Filter by type: sql, project | ||
--verbose | -V | false | Show full documentation |
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
# List all rules
leapsql rules
# Show details for a specific rule
leapsql rules AM01
# List SQL rules only
leapsql rules --type sql
# List rules in the modeling group
leapsql rules --group modeling
# Show full documentation
leapsql rules -V
# Output as JSON
leapsql rules --format json