Recode.Issue (Recode v0.8.0)

View Source

An Issue struct to track findings by the chechers.

Summary

Functions

Creates a new %Issue{}. See new/3 for examples.

Creates a new %Issue{}. See new/3 for examples.

Creates a new %Issue{}.

Types

t()

@type t() :: %Recode.Issue{
  column: non_neg_integer() | nil,
  line: non_neg_integer() | nil,
  message: String.t() | nil,
  meta: term(),
  reporter: module()
}

Functions

new(info)

@spec new(Keyword.t()) :: t()

Creates a new %Issue{}. See new/3 for examples.

new(reporter, info)

@spec new(atom(), String.t() | Keyword.t()) :: t()

Creates a new %Issue{}. See new/3 for examples.

new(reporter, message, info)

@spec new(atom(), String.t(), Keyword.t()) :: t()

Creates a new %Issue{}.

Parameters

  • reporter - atom(), the module reporting the issue
  • message - String.t(), the issue description
  • info - Keyword.t(), optional parameters including:
    • :line - non_neg_integer(), the line number
    • :column - non_neg_integer(), the column number
    • :meta - term(), additional metadata

Examples

iex> Recode.Issue.new(Test, "kaput", line: 1, column: 1)
%Recode.Issue{reporter: Test, message: "kaput", line: 1, column: 1, meta: nil}

iex> Recode.Issue.new(Test, meta: [foo: "bar"])
%Recode.Issue{reporter: Test, message: nil, line: nil, column: nil, meta: [foo: "bar"]}

iex> Recode.Issue.new(Test, "kaput")
%Recode.Issue{reporter: Test, message: "kaput", line: nil, column: nil, meta: nil}

iex> Recode.Issue.new(message: "kaput")
%Recode.Issue{reporter: Recode, message: "kaput", line: nil, column: nil, meta: nil}