Skip to content

Commit

Permalink
Ignore missing return value for rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jochemvandooren committed Mar 22, 2024
1 parent a21c5c4 commit 8d94bf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/dbt_score/rules/generic.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""All generic rules."""

from dbt_score.models import Model
from dbt_score.rule import RuleViolation, rule

# mypy: disable-error-code="return"


@rule()
def has_description(model: Model) -> RuleViolation | None:
"""A model should have a description."""
if not model.description:
return RuleViolation(message="Model lacks a description.")

return None


@rule()
def columns_have_description(model: Model) -> RuleViolation | None:
Expand All @@ -24,5 +23,3 @@ def columns_have_description(model: Model) -> RuleViolation | None:
message=f"The following columns lack a description: "
f"{', '.join(invalid_column_names)}."
)

return None
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def pytest_sessionfinish(session: Session, exitstatus: int):
def raw_manifest() -> Any:
"""Mock the raw manifest."""
return json.loads(
(Path(__file__).parent / "resources" / "manifest.json")
.read_text(encoding="utf-8")
(Path(__file__).parent / "resources" / "manifest.json").read_text(
encoding="utf-8"
)
)


Expand Down

0 comments on commit 8d94bf9

Please sign in to comment.