dbt™️ Macro checks
check-macro-has-description
check-macro-has-descriptionArguments
--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
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.0.0
hooks:
- id: check-macro-has-descriptionRequirements
Macro exists in manifest.json 1
Macro exists in catalog.json 2
❌ Not needed since it also validates properties files
❌ Not needed
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.
Known limitations
If you 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
check-macro-arguments-have-descArguments
--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json
Example
repos:
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v0.1.1
hooks:
- id: check-macro-arguments-have-descRequirements
Macro exists in manifest.json 1
Macro exists in catalog.json 2
❌ Not needed since it also validates properties files
❌ Not needed
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.
Known limitations
If you run and then you delete argument description from a properties file, the hook success since the description is still present in manifest.json.
Last updated
Was this helpful?