Last updated
Was this helpful?
Last updated
Was this helpful?
dbt™️-checkpoint is a collection of pre-commit hooks specifically designed for dbt™️ projects. It helps maintain consistent standards and catch common issues in your dbt™️ models before they get committed to your repository.
Why use dbt™️-checkpoint?
Ensures consistent dbt™️ model standards
Catches common dbt™️ issues early
Validates your dbt™️ project structure
Only checks files that have changed
Makes code reviews easier by catching issues automatically
You can specify a dbt™️ project root directory for all hooks. This is particularly useful when your dbt™️ project is not located at the root of your repository but in a sub-directory of it.
Create a .dbt-checkpoint.yaml
in the root of your repository and add the config dbt-project-dir
.
This way, we will automatically look for the required manifest/catalog inside your my_dbt_project
project folder.
dbt™️-checkpoint provides an extensive set of pre-commit hooks for dbt™️ projects.
Start with basic checks like model properties and tests, then gradually add more specific checks as your project grows and customize them to match your team's standards.
Most hooks require running dbt parse
first, so make sure your dbt™️ environment is properly set up.
: Check column descriptions are the same.
: Check column name abides to contract.
: Check the model columns have description.
: Check the model has all columns in the properties file.
: Check the model has contract enforced.
: Check the model has specific constraints defined.
: Check the model has description.
: Check the model has keys in the meta part.
: Check the model has keys in the labels part.
: Check the model has properties file.
: Check the model has a number of tests by test name.
: Check the model has a number of tests by test type.
: Check the model has a number of tests from a group of tests.
: Check the model has a number of tests.
: Check model name abides to contract.
: Check the model has a specific number (max/min) of parents or/and childs.
: Check the parent model has a specific database.
: Check the parent model names have a specific prefix.
: Check the parent model has a specific schema.
: Check the model has valid tags.
: Check the materialization of models given a threshold of child models.
: Check the script does not contain a semicolon.
: Check the script has not table name (is not using source()
or ref()
macro for all tables).
: Check the script has only existing refs and sources.
: Check for source column descriptions.
: Check the source has all columns in the properties file.
: Check the source table has description.
: Check the source has the freshness.
: Check the source has loader option.
: Check the source has keys in the meta part.
: Check the source has keys in the labels part.
: Check the source has a number of tests from a group of tests.
: Check the source has a number of tests by test name.
: Check the source has a number of tests by test type.
: Check the source has a number of tests.
: Check the source has valid tags.
: Check the source has a specific number (max/min) of childs.
: Check the macro has description.
: Check the macro arguments have description.
: If any source is missing this hook tries to create it.
: Generate model properties file.
: Unify column descriptions across all models.
: Replace table names with source()
or ref()
macros in the script.
: Remove the semicolon at the end of the script.
: Run dbt clean
command.
: Run dbt compile
command.
: Run dbt deps
command.
: Run dbt docs generate
command.
: Run dbt parse
command.
: Run dbt run
command.
: Run dbt test
command.
: ensures that the macro has a list of valid meta keys. (usually schema.yml
).
: ensures that the seed has a list of valid meta keys. (usually schema.yml
).
: ensures that the snapshot has a list of valid meta keys. (usually schema.yml
).
: ensures that the test has a list of valid meta keys. (usually schema.yml
).
: compare Manifest and Catalog to ensure DB and Schemas have the same casing.