> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt™-checkpoint Hooks

> dbt™️-checkpoint provides pre-commit hooks for dbt™️ projects, enforcing standards for model properties, tests, and documentation.

## **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**™️**-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.&#x20;

Create a  `.dbt-checkpoint.yaml` in the root of your repository and add the config `dbt-project-dir`.

```yaml theme={"system"}
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.&#x20;

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.&#x20;

Most hooks require running `dbt parse` first, so make sure your dbt™️ environment is properly set up.

### **Model checks**

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

### **Script checks**

* [`check-script-semicolon`](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks#check-script-semicolon): Check the script does not contain a semicolon.
* [`check-script-has-no-table-name`](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks#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`](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks#check-script-ref-and-source): Check the script has only existing refs and sources.

### **Source checks**

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

### **Macro checks**

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

### **Modifiers**

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

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

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

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

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


## Related topics

- [dbt™ Modifiers](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-modifiers.md)
- [dbt™ Source Checks](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-source-checks.md)
- [dbt™ Checks](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-checks.md)
- [dbt™ Model Checks](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-model-checks.md)
- [dbt™ Script Checks](/integrations/pre-commit/dbt-tm-checkpoint-hooks/dbt-tm-script-checks.md)
