Skip to content

Commit

Permalink
Prevent Rule from being discovered by rule registry (#12)
Browse files Browse the repository at this point in the history
- Prevent `Rule` from being added to the set of rules.
- At the same time, fix a small documentation typo.
  • Loading branch information
jochemvandooren authored Apr 23, 2024
1 parent 1ced0af commit ca61338
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/reference/scoring.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# CLI
# Scoring

::: dbt_score.scoring
2 changes: 1 addition & 1 deletion src/dbt_score/rule_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _load(self, namespace_name: str) -> None:
module = importlib.import_module(module_name)
for obj_name in dir(module):
obj = module.__dict__[obj_name]
if type(obj) is type and issubclass(obj, Rule):
if type(obj) is type and issubclass(obj, Rule) and obj is not Rule:
self._add_rule(obj_name, obj)

def _add_rule(self, name: str, rule: Type[Rule]) -> None:
Expand Down

0 comments on commit ca61338

Please sign in to comment.