rebar3_erli18n_host (rebar3_erli18n v0.1.0)

Copy Markdown View Source

Single seam over the rebar3 HOST API.

Every call into rebar3's own modules (providers, rebar_state, rebar_api, rebar_app_info) is funneled through this one module. Those modules are supplied by the rebar3 escript at plugin-load time; they are NOT a fetchable dependency (rebar3's built-in dep resources are git/hg/pkg only, and there is no rebar package carrying them), so the static analysis tools cannot load their definitions standalone.

Concentrating the host coupling here means every "this lives in the rebar3 host" annotation sits in this ONE module, and the providers plus the pure logic modules call rebar3_erli18n_host:* (which IS defined) so they stay free of host-API references and analyze cleanly with no per-site annotation. The three analysis tools are satisfied as follows, all scoped to this seam:

  • elp eqwalizer: a % elp:ignore W0017 on each host call site below;
  • dialyzer: a single function-scoped -dialyzer({no_unknown, [...]});
  • xref: a scoped -ignore_xref([...]) (below) listing both this seam's own exported wrappers and the eight external rebar3 host {M,F,A} edges, so undefined_function_calls/undefined_functions stay active everywhere else. The companion {xref_ignores,...} in this app's rebar.config carries the same eight edges with the rejected-alternatives rationale. This REPLACES the deleted tools/rebar3_api/ebin host-beam extraction.

The seam is also a genuine architectural win: it gives the providers a thin, mockable boundary instead of reaching into rebar3 internals directly.

Summary

Types

Opaque rebar3 app-info handle (rebar_app_info:t/0).

Opaque rebar3 provider handle (providers:t/0).

Opaque rebar3 state handle (rebar_state:t/0).

Functions

Register a provider into the rebar3 state.

The on-disk directory of an app.

Print a message to the console through rebar3.

Create a rebar3 provider record from a property list.

Emit an INFO-level message through the rebar3 logger.

The parsed getopt args for the running command (the proplist half).

The project's top-level apps.

The base directory of the rebar3 state.

Types

app_info()

-type app_info() :: term().

Opaque rebar3 app-info handle (rebar_app_info:t/0).

provider()

-type provider() :: term().

Opaque rebar3 provider handle (providers:t/0).

state()

-type state() :: term().

Opaque rebar3 state handle (rebar_state:t/0).

Functions

add_provider(State, Provider)

-spec add_provider(state(), provider()) -> state().

Register a provider into the rebar3 state.

app_dir(App)

-spec app_dir(app_info()) -> file:filename().

The on-disk directory of an app.

console(Format, Args)

-spec console(io:format(), [term()]) -> ok.

Print a message to the console through rebar3.

create_provider(Props)

-spec create_provider([{atom(), term()}]) -> provider().

Create a rebar3 provider record from a property list.

info(Format, Args)

-spec info(io:format(), [term()]) -> ok.

Emit an INFO-level message through the rebar3 logger.

parsed_args(State)

-spec parsed_args(state()) -> [{atom(), term()}].

The parsed getopt args for the running command (the proplist half).

project_apps(State)

-spec project_apps(state()) -> [app_info()].

The project's top-level apps.

state_dir(State)

-spec state_dir(state()) -> file:filename().

The base directory of the rebar3 state.