# dbt™️-checkpoint hooks

## **What is dbt™️-checkpoint?**

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**™&#xFE0F;**-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

## Setting dbt™️ project root

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`.

```yaml
version: 1
dbt-project-dir: my_dbt_project
```

This way, we will automatically look for the required manifest/catalog inside your `my_dbt_project` project folder.

## **Hooks**

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.

### **Model checks**

* [`check-column-desc-are-same`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-column-desc-are-same): Check column descriptions are the same.
* [`check-column-name-contract`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-column-name-contract): Check column name abides to contract.
* [`check-model-columns-have-desc`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-columns-have-desc): Check the model columns have description.
* [`check-model-has-all-columns`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-all-columns): Check the model has all columns in the properties file.
* [`check-model-has-contract`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-contract): Check the model has contract enforced.
* [`check-model-has-constraints`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-constraints): Check the model has specific constraints defined.
* [`check-model-has-description`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-description): Check the model has description.
* [`check-model-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-meta-keys): Check the model has keys in the meta part.
* [`check-model-has-labels-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-labels-keys): Check the model has keys in the labels part.
* [`check-model-has-properties-file`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-properties-file): Check the model has properties file.
* [`check-model-has-tests-by-name`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-tests-by-name): Check the model has a number of tests by test name.
* [`check-model-has-tests-by-type`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-tests-by-type): Check the model has a number of tests by test type.
* [`check-model-has-tests-by-group`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-tests-by-group): Check the model has a number of tests from a group of tests.
* [`check-model-has-tests`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-has-tests): Check the model has a number of tests.
* [`check-model-name-contract`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-name-contract): Check model name abides to contract.
* [`check-model-parents-and-childs`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-parents-and-childs): Check the model has a specific number (max/min) of parents or/and childs.
* [`check-model-parents-database`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-parents-database): Check the parent model has a specific database.
* [`check-model-parents-name-prefix`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-parents-name-prefix): Check the parent model names have a specific prefix.
* [`check-model-parents-schema`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-parents-schema): Check the parent model has a specific schema.
* [`check-model-tags`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-tags): Check the model has valid tags.
* [`check-model-materialization-by-childs`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md#check-model-parents-and-childs): Check the materialization of models given a threshold of child models.

### **Script checks**

* [`check-script-semicolon`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks.md#check-script-semicolon): Check the script does not contain a semicolon.
* [`check-script-has-no-table-name`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks.md#check-script-has-no-table-name): Check the script has not table name (is not using `source()` or `ref()` macro for all tables).
* [`check-script-ref-and-source`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks.md#check-script-ref-and-source): Check the script has only existing refs and sources.

### **Source checks**

* [`check-source-columns-have-desc`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-columns-have-desc): Check for source column descriptions.
* [`check-source-has-all-columns`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-all-columns): Check the source has all columns in the properties file.
* [`check-source-table-has-description`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-table-has-description): Check the source table has description.
* [`check-source-has-freshness`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-freshness): Check the source has the freshness.
* [`check-source-has-loader`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-loader): Check the source has loader option.
* [`check-source-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-meta-keys): Check the source has keys in the meta part.
* [`check-source-has-labels-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-labels-keys): Check the source has keys in the labels part.
* [`check-source-has-tests-by-group`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-tests-by-group): Check the source has a number of tests from a group of tests.
* [`check-source-has-tests-by-name`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-tests-by-name): Check the source has a number of tests by test name.
* [`check-source-has-tests-by-type`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-tests-by-type): Check the source has a number of tests by test type.
* [`check-source-has-tests`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-has-tests): Check the source has a number of tests.
* [`check-source-tags`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-tags): Check the source has valid tags.
* [`check-source-childs`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md#check-source-childs): Check the source has a specific number (max/min) of childs.

### **Macro checks**

* [`check-macro-has-description`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-macro-checks.md#check-macro-has-description): Check the macro has description.
* [`check-macro-arguments-have-desc`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-macro-checks.md#check-macro-arguments-have-desc): Check the macro arguments have description.

### **Modifiers**

* [`generate-missing-sources`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md#generate-missing-sources): If any source is missing this hook tries to create it.
* [`generate-model-properties-file`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md#generate-model-properties-file): Generate model properties file.
* [`unify-column-description`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md#unify-column-description): Unify column descriptions across all models.
* [`replace-script-table-names`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md#replace-script-table-names): Replace table names with `source()` or `ref()` macros in the script.
* [`remove-script-semicolon`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md#remove-script-semicolon): Remove the semicolon at the end of the script.

### **dbt**™️ **commands**

* [`dbt-clean`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-clean): Run `dbt clean` command.
* [`dbt-compile`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-compile): Run `dbt compile` command.
* [`dbt-deps`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-deps): Run `dbt deps` command.
* [`dbt-docs-generate`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-docs-generate): Run `dbt docs generate` command.
* [`dbt-parse`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-parse): Run `dbt parse` command.
* [`dbt-run`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-run): Run `dbt run` command.
* [`dbt-test`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-commands.md#dbt-test): Run `dbt test` command.

### **dbt**™️ **checks**

* [`check-macro-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md#check-macro-has-meta-keys): ensures that the macro has a list of valid meta keys. (usually `schema.yml`).
* [`check-seed-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md#check-seed-has-meta-keys): ensures that the seed has a list of valid meta keys. (usually `schema.yml`).
* [`check-snapshot-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md#check-snapshot-has-meta-keys): ensures that the snapshot has a list of valid meta keys. (usually `schema.yml`).
* [`check-test-has-meta-keys`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md#check-test-has-meta-keys): ensures that the test has a list of valid meta keys. (usually `schema.yml`).
* [`check-database-casing-consistency`](/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md#check-database-casing-consistency): compare Manifest and Catalog to ensure DB and Schemas have the same casing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/documentation/integrations/code-ide/pre-commit/dbt-tm-checkpoint-hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
