Skip to main content

W0079 - ELP CI Test Diagnostic

Warning

-module(main).
-export([go/0]).

go() ->
elp_ci:provoke_diagnostic("hello from CI", warning).
%% ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: CI test diagnostic (Warning): hello from CI

Explanation

This is a synthetic diagnostic used to exercise ELP's end-to-end integration. It fires whenever the linter encounters a call of the shape:

elp_ci:provoke_diagnostic(Message, Level)

elp_ci:provoke_diagnostic/2 is not a real Erlang function — it exists only as a marker so that engineers can deliberately inject a known diagnostic into a file in order to verify that the surrounding tooling (lint runs, reporting, dashboards, alerts, …) is wired up correctly.

Arguments

  • Message — a string literal that is rendered verbatim in the diagnostic text, so you can correlate a particular call site with a particular CI run.
  • Level — an atom selecting how the linter should respond:
    • panic — the linter panics, simulating an internal ELP crash.
    • error — emit the diagnostic at error severity.
    • warning — emit the diagnostic at warning severity.
    • notice — emit the diagnostic at weak-warning (notice) severity.

Anything else (or a non-literal argument) defaults to warning.

Example

%% Emit an error-level diagnostic with a specific message.
elp_ci:provoke_diagnostic("verify error reporting", error).

%% Force the linter to panic to test crash handling.
elp_ci:provoke_diagnostic("verify crash reporting", panic).

Because this diagnostic is intentionally synthetic, calls to elp_ci:provoke_diagnostic/2 should never be left in production code.