The dbt-autofix-fix (and dbt-autofix-check) pre-commit hooks always pass without fixing anything when the dbt project lives in a subdirectory of the repo (e.g. ./dbt/). No error or warning is emitted — the hook reports Passed even though deprecations exist.
Environment
dbt-autofix version: v0.20.3
- Repo layout: monorepo where the dbt project is at
./dbt/ (not the repo root)
pre-commit version: 4.5.1
- Environment variable
DBT_PROJECT_DIR set to <repo-root>/dbt
Steps to reproduce
- Have a repo where
dbt_project.yml lives at ./dbt/dbt_project.yml (not ./dbt_project.yml)
- Add the hook to
.pre-commit-config.yaml:
- repo: https://github.com/dbt-labs/dbt-autofix
rev: v0.20.3
hooks:
- id: dbt-autofix-fix
args: [--path=dbt]
- Run
pre-commit install to install the hook
- Introduce a YAML file with a known deprecation (e.g.
dbt_utils.accepted_range test arguments not nested under arguments:)
- Run
uvx dbt-autofix deprecations --dry-run to return the list of deprecations and confirm the deprecation added above is listed
- Run
pre-commit run dbt-autofix-fix --all-files
Expected: Hook detects and fixes the deprecation, exits 1, and asks you to re-stage.
Actual: Hook reports Passed with exit code 0. No files are modified.
The
dbt-autofix-fix(anddbt-autofix-check) pre-commit hooks always pass without fixing anything when the dbt project lives in a subdirectory of the repo (e.g../dbt/). No error or warning is emitted — the hook reportsPassedeven though deprecations exist.Environment
dbt-autofixversion:v0.20.3./dbt/(not the repo root)pre-commitversion:4.5.1DBT_PROJECT_DIRset to<repo-root>/dbtSteps to reproduce
dbt_project.ymllives at./dbt/dbt_project.yml(not./dbt_project.yml).pre-commit-config.yaml:pre-commit installto install the hookdbt_utils.accepted_rangetest arguments not nested underarguments:)uvx dbt-autofix deprecations --dry-runto return the list of deprecations and confirm the deprecation added above is listedpre-commit run dbt-autofix-fix --all-filesExpected: Hook detects and fixes the deprecation, exits 1, and asks you to re-stage.
Actual: Hook reports
Passedwith exit code 0. No files are modified.