Skip to content

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

OptionShortDefaultDescription
--disable[]Rule IDs to disable
--format-fOutput format: text, json
--rule[]Run only specific rules
--severitywarningMinimum severity: error, warning, info, hint
--skip-projectfalseSkip project health linting
--verbose-vfalseShow rule documentation with violations

Global Options

OptionShortDefaultDescription
--configconfig file (default: ./leapsql.yaml)
--databasePath to DuckDB database (empty for in-memory)
--envEnvironment name
--macros-dirPath to macros directory
--models-dirPath to models directory
--output-oOutput format (auto|text|markdown|json)
--project-dir-CProject root directory (auto-detected from models-dir or config file location)
--seeds-dirPath to seeds directory
--statePath to state database
--target-tTarget 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

Released under the MIT License.