blocked v0.10.0 API Reference

Modules

Usage

  1. Put require Blocked in your module to be able to use the exposed macro.
  2. Write Blocked.by(issue_reference, reason, do: ..., else: ...) wherever you have to apply a temporary fix.

Example:

defmodule Example do
  require Blocked

  def main do
    IO.puts("Hello, world!")
    Blocked.by("#42", "This code can be removed when the issue is closed") do
      hacky_workaround()
    end

    # The reason is optional
    Blocked.by("#69") do
      a_quick_fix()
    end

    # It is possible to indicate
    # the desired 'ideal' code as well, by passing an `else` block:
    Blocked.by("#1337") do
      ugly_fallback()
    else
      beautiful_progress()
    end

    # If the blockage is more general, you can also leave out the `do` block.
    Blocked.by("#65535", "This whole module can be rewritten once we're on the new Elixir version!")

    # Blocked supports many ways of referring to an issue
    Blocked.by("#13")
    Blocked.by("elixir#13")
    Blocked.by("elixir/13")
    Blocked.by("elixir-lang/elixir#13")
    Blocked.by("elixir-lang/elixir/13")
    Blocked.by("https://github.com/elixir-lang/elixir/issues/13")
  end
end

When will Blocked.by/3 run?

By default, the checks will only be performed inside Continuous Integration environments. (That is, any place where System.get_env("CI") is set). The reason for this default is that the checks perform HTTP requests to the GitHub-API, which will slow down compilation somewhat.

Configuration for Blocked.