Skip to content

Commit ce57c31

Browse files
Add more dialyzer checks (#51)
* Add more dialyzer checks * Recover unmatched_returns
1 parent 89194cd commit ce57c31

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/erlang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
otp: ['23.3', '24.3', '25.2.1']
16+
otp: ['25.2.1']
1717
rebar: ['3.20.0']
1818

1919
steps:

rebar.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
{profiles, [{test, [{deps, [{meck, "~> 0.9.2"}]}]}]}.
1313

14-
{dialyzer, [{warnings, [no_return, unmatched_returns, error_handling, underspecs]}]}.
14+
{dialyzer,
15+
[{warnings,
16+
[no_return, unmatched_returns, error_handling, missing_return, extra_return]}]}.
1517

1618
{edoc_opts,
1719
[{todo, true},

src/rebar3_depup_prv.erl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ opts() ->
5656
"Only update if the specified SemVer component (major, minor, or patch) has changed."}].
5757

5858
%% @private
59-
-spec do(rebar_state:t()) -> {ok, rebar_state:t()}.
59+
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, iodata()}.
6060
do(State) ->
6161
Opts = parse_opts(State),
6262
rebar_api:debug("Opts: ~p", [Opts]),
@@ -87,8 +87,14 @@ do(State) ->
8787
%% @private
8888
-spec format_error(any()) -> binary().
8989
format_error(Reason) ->
90-
unicode:characters_to_binary(
91-
io_lib:format("~tp", [Reason])).
90+
case unicode:characters_to_binary(
91+
io_lib:format("~tp", [Reason]))
92+
of
93+
{_Error, Bin, _Rest} ->
94+
Bin;
95+
Bin ->
96+
Bin
97+
end.
9298

9399
parse_opts(State) ->
94100
{Args, _} = rebar_state:command_parsed_args(State),

0 commit comments

Comments
 (0)