Protocol For Deps

View Source

rebar.config dependencies should use known protocols.

Avoid

{deps, [
    {elvis_core, {git, "git@github.com:inaka/elvis_core.git", {tag, "4.0.0"}}}
]}

Prefer

{deps, [
    {elvis_core, {git, "https://github.com/inaka/elvis_core.git", {tag, "4.0.0"}}}
]}

Rationale

Using an unknown or incorrect protocol (e.g., foo) might cause rebar3 to fail during dependency resolution. Ensuring that only recognized protocols are used makes builds reliable and avoids obscure errors during fetching or compilation. It also increases consistency across your codebase.

Options

  • regex :: string()
    • default: "^(https://|git://|\\d+(\\.\\d+)*)"
  • ignore :: [atom()]
    • default: []

regex was "https://.*|[0-9]+([.][0-9]+)*)" until 4.0.0.

Example configuration

{elvis_project, protocol_for_deps, #{
    regex => "^(https://|git://|\\d+(\\.\\d+)*)",
    ignore => []
}}