-
Notifications
You must be signed in to change notification settings - Fork 15
Support linting macros #142
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for linting dbt macros as a new evaluable entity type in dbt-score, enabling quality checks on macro definitions alongside existing support for models, sources, snapshots, seeds, and exposures.
- Introduces a new
Macrodataclass to represent dbt macros with relevant attributes - Implements three new rules for macro validation: description presence, argument documentation, and naming conventions
- Extends the evaluation pipeline to include macros throughout the codebase
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dbt_score/init.py | Exports the new Macro class for public API access |
| src/dbt_score/models.py | Adds Macro dataclass, updates Evaluable type alias, and implements macro loading in ManifestLoader |
| src/dbt_score/evaluation.py | Includes macros in the evaluation iteration and project evaluation checks |
| src/dbt_score/formatters/human_readable_formatter.py | Adds macro case to the pretty_name function |
| src/dbt_score/rules/macros.py | Implements three new rules for macro validation |
| tests/test_rule.py | Adds test cases for macro rule introspection |
| tests/test_models.py | Tests macro loading from manifest |
| tests/test_evaluation.py | Tests macro evaluation and filtering |
| tests/rules_library/test_macro_rules.py | Unit tests for the three new macro rules |
| tests/conftest.py | Adds macro fixtures and test rule fixtures |
| tests/resources/manifest.json | Adds test macro definitions to the test manifest |
| docs/index.md | Documents macros as a supported entity type |
| docs/create_rules.md | Updates rule creation documentation to mention macros |
| docs/rules/macros.md | Placeholder for generated macro rules documentation |
| mkdocs.yml | Adds macro rules to documentation navigation |
| .github/workflows/release.yml | Adds macro rules documentation generation to release workflow |
| CHANGELOG.md | Documents the new feature |
Comments suppressed due to low confidence (1)
src/dbt_score/rules/macros.py:5
- Import of 'Severity' is not used.
from dbt_score import Macro, RuleViolation, Severity, rule
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b92cdca to
30ba383
Compare
michael-the1
left a comment
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.
No notes, very clean ✨
Fixes #139.