check-script-ref-and-source
What it doesEnsures that the script contains only existing sources or macros.When to use itMake sure you have only valid ref and sources in your script and you do not want to wait for
dbt run to find them. This hook also finds all missing ref and sources, not find first missing only.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json
Example
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
check-script-semicolon
What it doesEnsure that the script does not have a semicolon at the end of the file.When to use itMake sure you did not provide a semicolon at the end of the file.
- Hook takes all changed
SQLfiles. - It parses
SQLand finds all sources and refs. If those objects do not exist inmanifest.json, the hook fails.
Requirements
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
SQLfiles. - If the file contains a semicolon at the end of the file, the hook fails.
check-script-has-no-table-name
What it doesEnsures that the script is using only source or ref macro to specify the table name.When to use itTo make sure that you have only refs and sources in your
SQL files.--ignore-dotless-table: consider all tables without dot in name as CTE
Example
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
SQLfiles. SQLis parsed and if it contains direct tables (not ref() or source()), the hook fails.