Configuration

dbtective supports multiple configuration formats to fit your project needs. You can use YAML, TOML, or integrate with your existing pyproject.toml file.

Supported formats:

  • dbtective.yml or dbtective.yaml - YAML format (recommended for dbt projects)
  • dbtective.toml - TOML format
  • pyproject.toml - For Python projects, config goes under [tool.dbtective]

Complete Example

Since everyone hates reading documentation they don’t need. Let’s start with a complete example:

manifest_tests:
  # Ensure all models and sources have descriptions
  - name: "models_must_have_description"
    type: "has_description"
    severity: "error"
    applies_to: ["models", "sources"]
    description: "All models and sources must have a description."

  # Enforce snake_case naming for all objects
  - name: "naming_convention"
    type: "name_convention"
    description: "All objects must follow the snake_case naming convention."
    pattern: "snake_case"
    severity: "error"

  # Warn if staging models lack descriptions
  - name: "staging_description_warning"
    type: "has_description"
    severity: "warning"
    applies_to: ["models"]
    includes:
      - "models/staging/**"
    description: "Staging models should have descriptions."

  # Ensure mart models have descriptions (excluding deprecated)
  - name: "marts_must_have_description"
    type: "has_description"
    severity: "error"
    applies_to: ["models"]
    includes:
      - "models/marts/**"
    excludes:
      - "models/marts/deprecated/**"
    description: "All mart models must have descriptions."
# Ensure all models and sources have descriptions
[[manifest_tests]]
name = "models_must_have_description"
type = "has_description"
severity = "error"
applies_to = ["models", "sources"]
description = "All models and sources must have a description."

# Enforce snake_case naming for all objects
[[manifest_tests]]
name = "naming_convention"
type = "name_convention"
description = "All objects must follow the snake_case naming convention."
pattern = "snake_case"
severity = "error"

# Warn if staging models lack descriptions
[[manifest_tests]]
name = "staging_description_warning"
type = "has_description"
severity = "warning"
applies_to = ["models"]
includes = ["models/staging/**"]
description = "Staging models should have descriptions."

# Ensure mart models have descriptions (excluding deprecated)
[[manifest_tests]]
name = "marts_must_have_description"
type = "has_description"
severity = "error"
applies_to = ["models"]
includes = ["models/marts/**"]
excludes = ["models/marts/deprecated/**"]
description = "All mart models must have descriptions."
[tool.dbtective]

# Ensure all models and sources have descriptions
[[tool.dbtective.manifest_tests]]
name = "models_must_have_description"
type = "has_description"
severity = "error"
applies_to = ["models", "sources"]
description = "All models and sources must have a description."

# Enforce snake_case naming for all objects
[[tool.dbtective.manifest_tests]]
name = "naming_convention"
type = "name_convention"
description = "All objects must follow the snake_case naming convention."
pattern = "snake_case"
severity = "error"

# Warn if staging models lack descriptions
[[tool.dbtective.manifest_tests]]
name = "staging_description_warning"
type = "has_description"
severity = "warning"
applies_to = ["models"]
includes = ["models/staging/**"]
description = "Staging models should have descriptions."

# Ensure mart models have descriptions (excluding deprecated)
[[tool.dbtective.manifest_tests]]
name = "marts_must_have_description"
type = "has_description"
severity = "error"
applies_to = ["models"]
includes = ["models/marts/**"]
excludes = ["models/marts/deprecated/**"]
description = "All mart models must have descriptions."

Config File Detection

dbtective automatically detects and loads your configuration file. If you have multiple config files in your project directory, dbtective will use the following priority order:

  1. dbtective.yml or dbtective.yaml (highest priority)
  2. dbtective.toml
  3. pyproject.toml (lowest priority)

What happens with multiple configs:

  • If multiple config files are found, dbtective will use the highest priority one
  • A warning will be displayed showing which files were found and which one was chosen
  • You can override auto-detection by explicitly specifying a config file with --config-file

Rule Configuration

PropertyRequiredDescription
typeYesThe type of rule to perform see individual rule documentation
nameNoCustom name to show for the rule. Defaults to the rule type if not specified
severityNoerror (fails rule, default) or warning (reports but doesn’t fail)
descriptionNoHuman-readable description of the rule
applies_toNoList of dbt object types to include (e.g., ["models", "sources"]). See individual rule documentation for valid targets
includesNoFile path patterns to include. Supports glob syntax (e.g., models/staging/**)
excludesNoFile path patterns to exclude. Supports glob syntax (e.g., models/deprecated/**)
model_materializationsNoFilter models by materialization type (e.g., ["table", "incremental"]). Only applies when applies_to includes models. Built-in types: table, view, incremental, ephemeral, materialized_view. Custom materializations are also supported.
custom_fieldsSometimesCustom fields for rules. See individual rule documentation