-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I think the pre-commit hooks added in #172 and improved in #183 have an implicit assumption that the dbt-project.yml lives in the repository root directory.
Our repository folder structure looks like this:
.git
.github/
jaffle-shop
dbt_project.yml
models/
mart/
schema.yml
Running the pre-commit hook against a project with changes:
pre-commit run --all-files --verbose dbt-autofix-fix
Fix dbt deprecations.....................................................Passed
- hook id: dbt-autofix-fix
- duration: 2.49s
Error: dbt_project.yml not found in /Path/To/JaffleProject/jaffle-shop
Error: dbt_project.yml not found in /Path/To/JaffleProject/jaffle-shop
Error: dbt_project.yml not found in /Path/To/JaffleProject/jaffle-shop
Error: dbt_project.yml not found in /Path/To/JaffleProject/jaffle-shopRunning the cli script with path from the repository root works:
uvx dbt-autofix deprecations --path=jaffle-shop
Refactored /Path/To/JaffleProject/jaffle-shop/models/mart/schema.yml:I've had a look at pre_commit_hooks/check_deprecations.py and it doesn't look like the root_path is configurable. Could this be exposed as a CLI arg in the pre-commit hook so we can write something like?
# .pre-commit-config.yaml
repos:
- repo: https://github.com/dbt-labs/dbt-autofix
rev: v0.16.1
hooks:
- id: dbt-autofix-fix
args: [--project-dir=jaffle-shop]dolbinskaBW and jairus-m
Metadata
Metadata
Assignees
Labels
No labels