Skip to content
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

[BUG] Precommit config installed in ['.'] folder #446

Closed
mjkanji opened this issue Mar 7, 2024 · 0 comments · Fixed by #447
Closed

[BUG] Precommit config installed in ['.'] folder #446

mjkanji opened this issue Mar 7, 2024 · 0 comments · Fixed by #447
Labels
bug Something isn't working dependencies Pull requests that update a dependency file triaged: no Hasn't been approved for future implementation

Comments

@mjkanji
Copy link

mjkanji commented Mar 7, 2024

Describe the bug
Maybe this is intended (in which case it's a rather unusual choice), but when I ran dbt-coves setup precommit, it created all of the config files inside a ['.'] folder. See the tree below:

├── ['.']
│   ├── .dbt-coves-precommit.yaml
│   ├── .sqlfluff
│   ├── .sqlfluffignore
│   └── .yamllint
├── pre-commit-config.yaml

The only file that's in the root directory is pre-commit-config.yaml. This file's contents also have many references to the same folder:

pre-commit-config.yaml

files: ^['.']/models/

repos:
  - repo: https://github.com/dbt-checkpoint/dbt-checkpoint
    rev: v1.0.0

    hooks:
      - id: dbt-docs-generate
        args: ["--cmd-flags", "++project+dir", "['.']", "++no+compile"]
      - id: check-source-table-has-description
        files: ^['.']/models/

      - id: check-script-semicolon
      - id: check-script-has-no-table-name
      - id: check-script-ref-and-source
        args: ["--manifest", "['.']/target/manifest.json"]
      - id: check-model-has-description
        args: ["--manifest", "['.']/target/manifest.json"]
      - id: check-model-has-properties-file
        args: ["--manifest", "['.']/target/manifest.json"]

      # This does not work with deferral because dbt docs generate does not include models that dont exist in current db
      - id: check-model-has-all-columns
        args:
          [
            "--manifest",
            "['.']/target/manifest.json",
            "--catalog",
            "['.']/target/catalog.json",
          ]

  - repo: https://github.com/sqlfluff/sqlfluff
    # this is the version of sqlfluff, needs to be updated when using a new sqlfluff version (pip show sqlfluff)
    rev: 2.0.3
    hooks:
      - id: sqlfluff-lint
        language: python
        # Need these two dependencies.
        #   sqlfluff-templater-dbt should match the version of sqlfluff above in rev (pip show sqlfluff-templater-dbt)
        #   dbt-snowflake needs to match the version in ['.'] tab of Datacoves (pip show dbt-snowflake)
        additional_dependencies:
          ["sqlfluff-templater-dbt==2.0.3", "dbt-snowflake==1.3.1"]
        args: [--config, ['.']/.sqlfluff]

  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.17.0
    hooks:
      - id: yamllint
        args: [-c=.yamllint]
        exclude: ^['.']/.dbt_coves/templates

Having a folder with symbols in its name is a very unusual choice (and makes it very hard to refer to the folder in the terminal), so I'm assuming it's a bug?

To Reproduce
Steps to reproduce the behaviour:

  1. Run dbt-coves precommit in a repo.

Expected behaviour
A clear and concise description of what you expected to happen.

Console Log/Tracebacks
N/A. It's as simple as running dbt-coves setup precommit.

Desktop (please complete the following information):

  • OS: Linux (via WSL2 in Windows)
  • Browser Firefox
  • Version dbt-coves v1.7.2, dbt v1.7.8

Additional context
Add any other context about the problem here.

@mjkanji mjkanji added the bug Something isn't working label Mar 7, 2024
@github-actions github-actions bot added dependencies Pull requests that update a dependency file triaged: no Hasn't been approved for future implementation labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file triaged: no Hasn't been approved for future implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant