Skip to content

Formatters

Formatters are used to output CLI results.

Formatter

Bases: ABC

Abstract class to define a formatter.

Source code in src/dbt_score/formatters/__init__.py
class Formatter(ABC):
    """Abstract class to define a formatter."""

    def __init__(self, manifest_loader: ManifestLoader, config: Config):
        """Instantiate a formatter."""
        self._manifest_loader = manifest_loader
        self._config = config

    @abstractmethod
    def evaluable_evaluated(
        self, evaluable: Evaluable, results: EvaluableResultsType, score: Score
    ) -> None:
        """Callback when an evaluable item has been evaluated."""
        raise NotImplementedError

    @abstractmethod
    def project_evaluated(self, score: Score) -> None:
        """Callback when a project has been evaluated."""
        raise NotImplementedError

__init__(manifest_loader, config)

Instantiate a formatter.

Source code in src/dbt_score/formatters/__init__.py
def __init__(self, manifest_loader: ManifestLoader, config: Config):
    """Instantiate a formatter."""
    self._manifest_loader = manifest_loader
    self._config = config

evaluable_evaluated(evaluable, results, score) abstractmethod

Callback when an evaluable item has been evaluated.

Source code in src/dbt_score/formatters/__init__.py
@abstractmethod
def evaluable_evaluated(
    self, evaluable: Evaluable, results: EvaluableResultsType, score: Score
) -> None:
    """Callback when an evaluable item has been evaluated."""
    raise NotImplementedError

project_evaluated(score) abstractmethod

Callback when a project has been evaluated.

Source code in src/dbt_score/formatters/__init__.py
@abstractmethod
def project_evaluated(self, score: Score) -> None:
    """Callback when a project has been evaluated."""
    raise NotImplementedError