Workspace.Check.Result (Workspace v0.2.1)

View Source

A struct holding a check's result.

Contains info about the checked project if applicable, the check's config and the check status and metadata.

Summary

Types

t()

The internal representation of a workspace check result.

Functions

Initializes a check results struct for the given check and project

Sets the result's metadata.

Sets the result's status.

Types

t()

@type t() :: %Workspace.Check.Result{
  check: keyword(),
  meta: nil | keyword(),
  module: module(),
  project: Workspace.Project.t(),
  status: nil | :ok | :error | :skip
}

The internal representation of a workspace check result.

It includes the following fields:

  • :module - the underlying check module implementing the Workspace.Check behaviour
  • :check - the check configuration
  • :project - the Workspace.Project on which the check was executed
  • :status - the status of the check, will be :ok in case of success, :error in case of failure or :skip if the check was skipped for the current project.
  • :meta - arbitrary check metadata

Functions

new(check, project)

@spec new(check :: keyword(), project :: Workspace.Project.t()) :: t()

Initializes a check results struct for the given check and project

set_metadata(result, metadata)

@spec set_metadata(result :: t(), metadata :: keyword()) :: t()

Sets the result's metadata.

set_status(result, status)

@spec set_status(result :: t(), status :: atom()) :: t()

Sets the result's status.