Configuration
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.ymlordbtective.yaml- YAML format (recommended for dbt projects)dbtective.toml- TOML formatpyproject.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:
dbtective.ymlordbtective.yaml(highest priority)dbtective.tomlpyproject.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
| Property | Required | Description |
|---|---|---|
type | Yes | The type of rule to perform see individual rule documentation |
name | No | Custom name to show for the rule. Defaults to the rule type if not specified |
severity | No | error (fails rule, default) or warning (reports but doesn’t fail) |
description | No | Human-readable description of the rule |
applies_to | No | List of dbt object types to include (e.g., ["models", "sources"]). See individual rule documentation for valid targets |
includes | No | File path patterns to include. Supports glob syntax (e.g., models/staging/**) |
excludes | No | File path patterns to exclude. Supports glob syntax (e.g., models/deprecated/**) |
model_materializations | No | Filter 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_fields | Sometimes | Custom fields for rules. See individual rule documentation |