check-macro-has-description
What it doesEnsures that the macro has a description in the properties file (usually
macro.yml).When to use itYou want to make sure that all macros have a description.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json --exclude: Regex pattern to exclude files.
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
ymlandSQLfiles. - The macro name is obtained from the
SQLfile name. - The manifest is scanned for a macro.
- Modified
ymlfiles are scanned for a macro. - If any macro (from a manifest or
ymlfiles) does not have a description, the hook fails. - The macro description must be in either the yml file or the manifest.
run and then you delete the description from a properties file, the hook success since the description is still present in manifest.json.
check-macro-arguments-have-desc
What it doesEnsures that the macro has arguments with descriptions in the properties file (usually
schema.yml).When to use itYou want to make sure that all specified arguments in the properties files (usually schema.yml) have some description. This hook does not validate if all macro arguments are also present in a properties file.--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.
How it works
- Hook takes all changed
ymlandSQLfiles. - The macro name is obtained from the
SQLfile name. - The manifest is scanned for a macro.
- Modified
ymlfiles are scanned for a macro. - If any argument in the found macro does not contain a description, the hook fails.
- The description must be in either the yml file or the manifest.
run and then you delete argument description from a properties file, the hook success since the description is still present in manifest.json.