-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve documentation on how to apply rule filters #93
base: master
Are you sure you want to change the base?
Improve documentation on how to apply rule filters #93
Conversation
docs/configuration.md
Outdated
@@ -90,6 +90,18 @@ Every rule can be configured with the following option: | |||
be found in the same namespace as the rules (see | |||
[Package rules](package_rules.md)). | |||
|
|||
Example: the generic rule `has_example_sql` shall apply only to frontend models. |
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.
Nice, good example! One thing I would like is that the example is part of the bullet point, because it's an addition to the rule_filter_names
bulletpoint
docs/configuration.md
Outdated
With `only_frontend_models` defined in `my_project_rules.py` as: | ||
```python | ||
@rule_filter | ||
def only_frontend_models(model: Model) -> bool: | ||
-- condition which defines a frontend model | ||
``` |
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.
Instead of creating a new filter, maybe we could either:
- reference
only_schema_x
, which doesn't exist per se but is an already fictional example from the documentation page on "Create rules". We could even link to it - reference the one that will soon exist in https://github.com/PicnicSupermarket/dbt-score/pull/90/files#diff-b67e959fc5f44264b902f469b41aa975dde46f9547c14c4f12871ccd1662d952
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.
Nice! I picked the second option.
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.
Nice! Just some last formatting
@@ -90,6 +90,11 @@ Every rule can be configured with the following option: | |||
be found in the same namespace as the rules (see | |||
[Package rules](package_rules.md)). | |||
|
|||
Example: the generic rule `has_example_sql` shall apply only to models materializing a table. |
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.
Example: the generic rule `has_example_sql` shall apply only to models materializing a table. | |
Example: the generic rule `has_example_sql` shall apply only to models materializing a table. | |
Newline before code block
```toml | ||
[tool.dbt-score.rules."dbt_score.rules.generic.has_example_sql"] | ||
rule_filter_names=["rules.filters.is_table"] |
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.
Can you close the codeblock with triple-backticks?
Fixes #92