Skip to content

Commit

Permalink
Merge pull request #61 from inaka/elbrujohalcon.61.compatibility_with…
Browse files Browse the repository at this point in the history
…_otp19_

Compatibility with OTP19+
  • Loading branch information
elbrujohalcon committed Jun 30, 2018
2 parents 6c8cf71 + c827b3d commit 200cce5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 27 deletions.
14 changes: 3 additions & 11 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
{deps, [
{elvis_core, {git, "https://github.com/inaka/elvis_core.git", {tag, "0.2.11"}}}
]}
]},
{shell, [
{deps, [
{sync, {git, "https://github.com/rustyio/sync.git", {ref, "9c78e7b"}}}
]}
]}
]}.

Expand Down Expand Up @@ -66,26 +61,23 @@

%% == Dependencies ==

{deps, [{getopt, "0.8.2"}]}.
{deps, [{getopt, "1.0.1"}]}.

%% == Dialyzer ==

{dialyzer, [
{warnings, [ unmatched_returns
, error_handling
, unknown
]},
{get_warnings, true},
{plt_apps, top_level_deps},
{plt_extra_apps, []},
{plt_extra_apps, [erts, kernel]},
{plt_location, local},
{base_plt_apps, [stdlib, kernel]},
{base_plt_location, global}
]}.

%% == Shell ==

{shell, [{apps, [sync]}]}.

%% == Escriptize ==

{escript_name, "xrefr"}.
Expand Down
4 changes: 2 additions & 2 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"1.1.0",
[{<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},0}]}.
[{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0}]}.
[
{pkg_hash,[
{<<"getopt">>, <<"B17556DB683000BA50370B16C0619DF1337E7AF7ECBF7D64FBF8D1D6BCE3109B">>}]}
{<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}]}
].
1 change: 1 addition & 0 deletions src/xref_runner.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, stdlib
, tools
, erl_interface
, getopt
]},
{modules, []},
{registered, []},
Expand Down
2 changes: 1 addition & 1 deletion test/xref_runner_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ check_rebar3_build_fail(_Config) ->
_ = rebar3_compile(RepoName),
[Warning] = xref_runner:check(),

#{ line := 9
#{ line := 11
, check := undefined_function_calls
, filename := Filename
, source := {erlang_repo_fail_sup, init, 1}
Expand Down
6 changes: 4 additions & 2 deletions test_examples/erlang-repo-fail/src/erlang_repo_fail_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
-export([start/2]).
-export([stop/1]).

-spec start(_, [term()]) -> {ok, pid()}.
start(_Type, _Args) ->
erlang_repo_fail_sup:start_link().
erlang_repo_fail_sup:start_link().

-spec stop(_) -> ok.
stop(_State) ->
ok.
ok.

12 changes: 7 additions & 5 deletions test_examples/erlang-repo-fail/src/erlang_repo_fail_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

-export([start_link/0, init/1]).

-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
supervisor:start_link({local, ?MODULE}, ?MODULE, noargs).

init([]) ->
Procs = [],
erlang_repo_fail_app:non_exist_function(),
{ok, {{one_for_one, 1, 5}, Procs}}.
-spec init(noargs) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
init(noargs) ->
Procs = [],
erlang_repo_fail_app:non_exist_function(),
{ok, {{one_for_one, 1, 5}, Procs}}.
6 changes: 4 additions & 2 deletions test_examples/erlang-repo/src/erlang_repo_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
-export([start/2]).
-export([stop/1]).

-spec start(_, [term()]) -> {ok, pid()}.
start(_Type, _Args) ->
erlang_repo_sup:start_link().
erlang_repo_sup:start_link().

-spec stop(_) -> ok.
stop(_State) ->
ok.
ok.

10 changes: 6 additions & 4 deletions test_examples/erlang-repo/src/erlang_repo_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

-export([start_link/0, init/1]).

-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
supervisor:start_link({local, ?MODULE}, ?MODULE, noargs).

init([]) ->
Procs = [],
{ok, {{one_for_one, 1, 5}, Procs}}.
-spec init(noargs) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
init(noargs) ->
Procs = [],
{ok, {{one_for_one, 1, 5}, Procs}}.

0 comments on commit 200cce5

Please sign in to comment.