Skip to content

Commit

Permalink
Add more dialyzer checks (#51)
Browse files Browse the repository at this point in the history
* Add more dialyzer checks

* Recover unmatched_returns
  • Loading branch information
elbrujohalcon committed Feb 6, 2023
1 parent 89194cd commit ce57c31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
otp: ['23.3', '24.3', '25.2.1']
otp: ['25.2.1']
rebar: ['3.20.0']

steps:
Expand Down
4 changes: 3 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

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

{dialyzer, [{warnings, [no_return, unmatched_returns, error_handling, underspecs]}]}.
{dialyzer,
[{warnings,
[no_return, unmatched_returns, error_handling, missing_return, extra_return]}]}.

{edoc_opts,
[{todo, true},
Expand Down
12 changes: 9 additions & 3 deletions src/rebar3_depup_prv.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ opts() ->
"Only update if the specified SemVer component (major, minor, or patch) has changed."}].

%% @private
-spec do(rebar_state:t()) -> {ok, rebar_state:t()}.
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, iodata()}.
do(State) ->
Opts = parse_opts(State),
rebar_api:debug("Opts: ~p", [Opts]),
Expand Down Expand Up @@ -87,8 +87,14 @@ do(State) ->
%% @private
-spec format_error(any()) -> binary().
format_error(Reason) ->
unicode:characters_to_binary(
io_lib:format("~tp", [Reason])).
case unicode:characters_to_binary(
io_lib:format("~tp", [Reason]))
of
{_Error, Bin, _Rest} ->
Bin;
Bin ->
Bin
end.

parse_opts(State) ->
{Args, _} = rebar_state:command_parsed_args(State),
Expand Down

0 comments on commit ce57c31

Please sign in to comment.