Skip to content

Conversation

@matthieucan
Copy link
Contributor

Fixes #139.

@matthieucan matthieucan requested a review from Copilot November 3, 2025 16:15
Copy link

Copilot AI left a 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 Macro dataclass 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.

@matthieucan matthieucan force-pushed the matthieucan/lint-macros branch from b92cdca to 30ba383 Compare November 3, 2025 17:19
@matthieucan matthieucan marked this pull request as ready for review November 3, 2025 17:21
Copy link
Contributor

@michael-the1 michael-the1 left a 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 ✨

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.

Adding macros support

3 participants