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

Improve documentation on how to apply rule filters #93

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dennisboerger
Copy link

@dennisboerger dennisboerger commented Jan 3, 2025

Fixes #92

@dennisboerger dennisboerger self-assigned this Jan 3, 2025
@@ -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.
Copy link
Contributor

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

Comment on lines 98 to 103
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
```
Copy link
Contributor

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:

Copy link
Author

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.

Copy link
Contributor

@matthieucan matthieucan left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment on lines +94 to +96
```toml
[tool.dbt-score.rules."dbt_score.rules.generic.has_example_sql"]
rule_filter_names=["rules.filters.is_table"]
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Improve documentation on how to apply rule filters
3 participants