-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dcv 1682 possibility to change the dbt root for all hooks #138
Dcv 1682 possibility to change the dbt root for all hooks #138
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
==========================================
+ Coverage 98.58% 98.61% +0.02%
==========================================
Files 47 47
Lines 2269 2311 +42
Branches 304 309 +5
==========================================
+ Hits 2237 2279 +42
Misses 18 18
Partials 14 14
☔ View full report in Codecov by Sentry. |
@dbt-checkpoint/montreal-analytics @dbt-checkpoint/datacoves tests created, please provide any feedback as it seems this will be a nice addition as discussed in Issue #39 |
…DCV-1682-possibility-to-change-the-dbt-root-for-all-hooks
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR introduces the possibility of specifying your dbt project for all hooks.
This can be done by setting
dbt-project-dir
in the user's.dbt-checkpoint.yaml
:dbt-project-dir: my_project
With that, we modified the
get manifest
andget catalog
behavior to use this content.Now there is a precedence in flags and config usage:
--manifest path/to/manifest.json
or--cmd-flags ++project+dir
my_project/target/manifest.json
is passed to manifest or --project-dir in dbt commands--manifest
: target/manifest.jsonThis way, if both approaches are used,
args: []
content takes precedence over config file one.With these changes, it's no longer needed to provide a
--manifest
or--catalog
to each of thecheck[...]
hooks and repeating the sameargs
multiple times, leaving the following as a working example of.pre-commit-config.yaml
: