-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support other JSON schemas for dbt #3948
Conversation
Signed-off-by: Yu Ishikawa <[email protected]>
Signed-off-by: Yu Ishikawa <[email protected]>
Signed-off-by: Yu Ishikawa <[email protected]>
Signed-off-by: Yu Ishikawa <[email protected]>
src/api/json/catalog.json
Outdated
{ | ||
"name": "dbt Packages", | ||
"description": "dbt packages configurations", | ||
"fileMatch": ["**/packages.yml"], |
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.
I want to make it work even in a nested directory, because users potentially manage a dbt project in a nested directory, not the root directory.
src/api/json/catalog.json
Outdated
{ | ||
"name": "dbt Selectors", | ||
"description": "dbt selectors configurations", | ||
"fileMatch": ["**/selectors.yml"], |
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.
ditto
src/api/json/catalog.json
Outdated
"fileMatch": [ | ||
"**/macros/*.yml", | ||
"**/macros/**/*.yml", | ||
"**/macros/*.yaml", | ||
"**/macros/**/*.yaml", | ||
|
||
"**/models/*.yml", | ||
"**/models/**/*.yml", | ||
"**/models/*.yaml", | ||
"**/models/**/*.yaml", | ||
|
||
"**/seeds/*.yml", | ||
"**/seeds/**/*.yml", | ||
"**/seeds/*.yaml", | ||
"**/seeds/**/*.yaml", | ||
|
||
"**/snapshots/*.yml", | ||
"**/snapshots/**/*.yml", | ||
"**/snapshots/*.yaml", | ||
"**/snapshots/**/*.yaml" | ||
], |
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.
We can technically configure the directories instead of the default directories respectively. If we want the rules more flexible, we need to parse all YAML files. But, I'm not sure we can apply file match rules like **/*.yml
, **/**/*.yml
.
Thanks for PR; could the |
Signed-off-by: Yu Ishikawa <[email protected]>
41ba5bc
to
cb46470
Compare
for more information, see https://pre-commit.ci
@hyperupcall Sure. I have modified the patterns. Can you take a look again? |
Signed-off-by: Yu Ishikawa <[email protected]>
@hyperupcall Can you give me advice to solve this? Though I have changed the pattern from
|
@yu-iskw I believe that rule is set up because the glob patterns are recursive by default, so effectively But in my opinion, matching every yaml file in |
Hello! I'm a DX Advocate at dbt Labs (makers of dbt) - the way that the dbt CLI app knows it's in a dbt project is that it can find a Because of this, there isn’t a required folder pattern, but I would guess most project directories would contain dbt in them somewhere (and it'd be a reasonable convention to require for schemastore). Would you be open to a pattern like I ran it through Digital Ocean's glob checker and it seems to work: |
"snapshots/*.yaml", | ||
"snapshots/**/*.yaml" | ||
], | ||
"url": "https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/latest/selectors-latest.json" |
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.
"url": "https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/latest/selectors-latest.json" | |
"url": "https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/latest/dbt_yml_files-latest.json" |
Ideally, schema
Yes, that works! |
I can't contribute directly to this branch, but I've opened #3977 to implement the agreed approach |
Closing as superseded by #3977 |
Solves #3947
Reference